Quote:
Originally posted by Stickman
No.
Bill, are you suggesting that we all have
background:#fff;
background-color:transparent;
in our stylesheets just to appease an automated validation thing that gets confused?
|
Firstly, if you already have
background#fff then the validator won't be warning about absent backgrounds, so there's no need to repeat the declaration in the verbose form.
(I just used the verbose form in the example to be clear what I was getting at and to avoid overriding any
background-image attributes that may be set in those declaration blocks.
The shorthand
background: ...; attribute will override/clear all verbose background attributes that precede it, even if the values in the verbose attributes are not mentioned in the shorthand attribute. Clear as mud.

)
Secondly, as long as I have already implemented a background (colour) for the body, then I don't always bother to clean up warnings (unless there's just one or two).
It's usually only a matter of pasting the line into a few paces in the css and the css validates warning free.
Filesize isn't really a concern as correcting something like Mike's original example would only add an extra 100-300 bytes to the css file, depending on how you did it.
Once the
body background (colour) is set then the background/foreground colour behaviours become much more predictable in untested situations.
However, you'd be surprised to see just how many web-developers/designers still forget to set their body background.
Try changing your browser default background to a non-white colour and browse around for a bit and you'll see what I mean.
--
Of course, there's always the asterisk selector to fall back on.
It won't get rid of the validation warnings, but it will go a a fair way to addressing the usability concerns that the validator warnings are reminding you about.
(It is likely, as the validator becomes more intelligent, that the presence of the asterisk selector will be accounted for when assessing whether or not warnings should be given.)