View Full Version : CSS: Referencing a color from another selector

09-26-2006, 07:19 PM
Hello friends

I use some 3rd party component and I'm personalizing the style what is outputed.

Let's say what the component generate the style like this:

.Test { color: red; font-family: verdana; background-color: yellow; }

in my page I wrote just the code:

.Test { color: blue }

And my css overriden the component generated css correctly, maintaining the font-family and background-color, and changing the Color. But in the ".Test A" and ".Test A:hover" I need change ONLY the color from ".Test". I know not speak this in CSS terms, but in programming like language I wish do this:

.Test A, .Test A:hover{ color: .Test.Color }

Exists some manner to do this?

09-27-2006, 08:57 AM
Although admittedly this would be a useful option and this matter has been raised several times for that reason, alas: no, CSS offers no possibility to use a reference or a variable for supplying property values; just plain values.