|
Posted by Gιrard Talbot on 10/08/05 21:59
bcr07548@creighton.edu a Γ©crit :
> I was validating some CSS last night and kept getting warnings that my
> TD styles had a 'background-color' but no 'color.'
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
distinguishible.
W3C Quality Assurance tip for Webmasters:
If You Pick One Color, Pick Them All
http://www.w3.org/QA/Tips/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.
>
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
not inherited.
> 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?
> For example,
>
> body
> {
> background-color: #000088;
That is light blue.
> color: #0000FF;
color blue is not best. blue on light blue is not that contrasting, easy
to distinguish, to read.
Effective Color Contrast
http://www.lighthouse.org/color_contrast.htm
The default color for unvisited links is set to blue in all modern
browsers. Personally, I would avoid doing that.
> }
>
> td
> {
> background-color: #000044;
> color: body.color;
color: inherit;
'color'
Value: <color> | inherit
Initial: depends on user agent
6.2.1 The 'inherit' value
http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit
GΓ©rard
--
remove blah to email me
Navigation:
[Reply to this message]
|