开发者

Making a variable term have its own CSS when it appears within another variable

Within the variable $row["title"] below, I would like the variable $find to have the following CSS:

            font-family: Georgia, "Times New Roman", Times, serif;
            font-weight: normal;
            font-size: 24px;
            color: #004284;
            background-color: #FFFF00;   

How can I do this?

Thanks in advance,

echo '<td class="sitename1search">'.开发者_如何转开发$row["title"].'</td>';


First, declare the CSS this way:

td.sitename1search span.find {
    font-family: "Georgia", "Times New Roman", "Times", serif;
    font-weight: normal;
    font-size: 24px;
    color: #004284;
    background-color: #FFFF00;   
}

Then, when you construct $row["title"], wrap the $find variable in a span like this:

$row["title"] = " ... <span class='find'>$find</span> ... ";
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜