Welcome to WebmasterWorld Guest from

Forum Moderators: not2easy

Message Too Old, No Replies

A Word Displayed In RED



10:47 am on Sep 27, 2012 (gmt 0)

I want my “current airline” and “my first airline” to display in red (no link). I can’t seem to get. Could you please help?


<td width="100%" bgcolor="#F9F9F9" style="line-height:1.5em;" valign="top"><span class="liteGreyColor textsize10">Posted ' . $whenAnno . ': <span><a href="http://www.*********.com.php?id=' . $uid . '"> ' . $username . ' </a> with ' . $currentairline . ' in ' . $country . '. My first airline was ' . $myfirstairline . '. </a> I just wanted to say... </p></span>' . $the_anno . '<em></em></span>
<span class="textsize10"></span>

Thank you,


10:53 am on Sep 27, 2012 (gmt 0)

WebmasterWorld Senior Member topr8 is a WebmasterWorld Top Contributor of All Time 10+ Year Member

surround the words you want in red in <span></span> tags and give the span a class which makes the text red

something like..

in your stylesheet

and on your page:
<span class="red">' . $currentairline . ' </span>


2:01 pm on Sep 27, 2012 (gmt 0)

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

Don't use a class name like "red". If you ever decide you want them to be some other color (or style) then you'll either need to modify your HTML to use a different class, or you'll need to modify class red's style to be the other color which is confusing. A better option is to use class names that represent the content, not the presentation. For example, use a classname like "currentairline":

.currentairline { color: red; }

And on your page:
<span class="currentairline">' . $currentairline . '</span>

This way, if you decide that you want the current airline to be bold instead, you only need to make a change in the presentation layer (the CSS), and it all still makes sense.


8:38 pm on Sep 28, 2012 (gmt 0)

Thanks, topr8. Perfect!

Featured Threads

Hot Threads This Week

Hot Threads This Month