CSS: changing the font color based on the current color

I am trying to find css that will allow me to change the color of the text depending on the current color of the text.

Here is the HTML (not HTML5) that I am trying to modify:

<a href="link"><font color="green">2</font></a> <a href="link"><font color="red">3</font></a> <a href="link"><font color="red">2</font></a> <a href="link"><font color="green">3</font></a> <a href="link"><font color="red">2</font></a> <a href="link"><font color="green">3</font></a> 

What I want to do is change the red links to yellow and the green links to blue. I cannot use javascript or modify the HTML code. I am allowed to add CSS to change styles. Is there a way to do this using only CSS.

+7
source share
1 answer
 a font[color="red"] { color: yellow; } a font[color="green"] { color: blue; } 

http://jsfiddle.net/3zLfb/

+17
source

All Articles