Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Setting CSS property to another
October 8, 2005, 6:28 pm
rate this thread
TD styles had a 'background-color' but no 'color.' I didn't have one
because I wanted the text to be the color specified in the page's style
sheet. I thought that was the idea of CSS - styles "cascade" down and
any property not found for a particular tag at that level are then
searched for at higher levels of the DOM structure.
Anyway, for the sake of having the CSS validate without warnings, I
want to add color properties for the tags that need them. But for sake
of maintainability, can you set one CSS property equal to another so
you don't have to hunt down all the properties and change their values?
This is sort of what I am after but I haven't found any info on it
online and have no idea what the syntax would be, if it is even
possible. I've seen this asked in newsgroups (including this one) but
no one ever seems to answer the question. Does anyone know if this can
Re: Setting CSS property to another
It's just that once you have define a background-color, you need to
define the color too (or vice versa). What makes a text legible is that
there is enough contrast between background-color and color to make it
W3C Quality Assurance tip for Webmasters:
If You Pick One Color, Pick Them All
I didn't have one
Yes, that's how inheritable properties work. Not all properties are
inheritable; not all properties are inherited from containers if they
are not specifically defined.
Every listed CSS 2.x property has a field indicating whether it is or
That is light blue.
color blue is not best. blue on light blue is not that contrasting, easy
to distinguish, to read.
Effective Color Contrast
The default color for unvisited links is set to blue in all modern
browsers. Personally, I would avoid doing that.
Value: <color> | inherit
Initial: depends on user agent
6.2.1 The 'inherit' value
remove blah to email me