Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing font colors based on a variable

Status
Not open for further replies.

dburnham

Programmer
Oct 18, 2001
118
US
Is it possible to change a font color based on the results of a variable?

If <ilonweb FUNC=&quot;Hidden&quot; SYMBOL=&quot;NVL_nvi1&quot;></ilonweb>=1
then
<p align=&quot;center&quot;><font color=&quot;#FF0000&quot;>&nbsp;<ilonweb FUNC=&quot;ShowValue&quot; SYMBOL=&quot;NVL_nvi1&quot;></ilonweb></font>
else
<p align=&quot;center&quot;><font color=&quot;#00FF00&quot;>&nbsp;<ilonweb FUNC=&quot;ShowValue&quot; SYMBOL=&quot;NVL_nvi1&quot;></ilonweb></font>

I know that the code is not correct but this is the idea.

Thanks,
David

 
Hi mate,

It's possible to change any aspect of your page based on a variable, but you can't do it with HTML on it's own.

If you have a server-side language generating your HTML, then add some CSS to the page. If the variable passed is a hex code, then you can just echo it directly into the css, otherwise use your if statment to set the colour and then echo it.

Hope this helps

Wullie


The pessimist complains about the wind. The optimist expects it to change.
The leader adjusts the sails. - John Maxwell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top