Currently this code generates a colored hyperlink to an ad listing on my site. The problem is that the text is BLACK when viewing in Firefox and Chrome. It only seems to display the colored text in IE.
Can anyone please help me to make this work properly?
<a href="<?=ProdURL($rslt["offer_adsid"])?>" style="font-size:13px;"<?=$trColor?> ><?=$Lname?></a>
update:
here’s the HTML being generated. THANKS!
<a href="116-iphone-3g-8gb-as-is.htm" style="font-size:13px;"style="color:#FF0000;" >iPhone 3G 8GB AS IS</a
FIX!
I was able to fix this by finding where the value of $trColor is defined, then adding the font size style tag to be included along with the color style tag. Fixed now, thanks guys!
Thanks for giving the exact HTML output. I see two potential problems:
There is no space before the second
style=element. I’m guessing IE interprets this okay anyway, and the other browsers treat it as garbage and ignore it.I’m not sure if there’s an agreed-upon standard among the different mainline browsers of what to do when there are multiple
style="..."attributes on a single HTML element. I haven’t tried it, but immediate questions that come to my mind are: Should they be additive? Or should one of them overrule the other one? I’ve always known the “correct” method to be combining all CSS directives into onestyle="..."attribute, which you could easily do here.I would make
$trColorbe just the hexadecimal color code, and rewrite the HTML like this:So that your HTML is rendered like so: