Welcome to WebmasterWorld Guest from 54.163.54.95

Forum Moderators: not2easy

Message Too Old, No Replies

A Word Displayed In RED

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

Junior Member

joined:Feb 23, 2012
posts: 91
votes: 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?

Code…

<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,
S
10:53 am on Sept 27, 2012 (gmt 0)

Senior Member

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

joined:Apr 19, 2002
posts:3206
votes: 13


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
.red{color:red;}

and on your page:
<span class="red">' . $currentairline . ' </span>
2:01 pm on Sept 27, 2012 (gmt 0)

Senior Member from US 

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

joined:Oct 17, 2005
posts: 4988
votes: 12


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 Sept 28, 2012 (gmt 0)

Junior Member

joined:Feb 23, 2012
posts: 91
votes: 0


Thanks, topr8. Perfect!