|
Posted by Alan J. Flavell on 06/08/06 09:47
On Thu, 8 Jun 2006, Andy Dingley <dingbat@codesmiths.com> wrote:
> Vlatko Juric-Kokic wrote:
>
> > The validator gives warning "you have no background-color with
> > your color" for several elements. But I specifically put in
> > "background-color: transparent", which is allowed/required
> > according to CSS 2.1:
(except that "transparent" isn't really a "color", and coding it
doesn't really solve the potential problem which this warning is
telling you about.)
> It's only a warning - you can (and often should) ignore it.
I agree, but it's still advisable to be aware of why the warning is
there.
> In many cases you're mixing colour settings such as varying
> background colours on the rows of a table and text colours for
> different columns or particular highlights. CSS checking will give
> you a warning (it can't _prove_ that the text will always be
> visible) but you, at a higher level as the page designer, still know
> that it's safe.
No argument with that part, but you're not mentioning the "cascading"
part of cascading stylesheets. If the author's settings are getting
cascaded with a user stylesheet, then you could end up with the
author's specified text against the user's specified background, with
no guarantee that they would contrast - they might even be the same,
causing text to disappear.
In a more general situation there might be a third stylesheet, imposed
by the corporate web server to get the corporate web style applied to
stylesheets. Individual authors in general won't know what new
corporate style the manglement are going to produce out of their hat
tomorrow, so the fact that it appears to work today is no guarantee
that it'll work tomorrow. It's more robust if you /can/ be explicit:
specify either explicit colours for text /and/ for background, or for
neither, at every specificity which you use. But it isn't always
feasible, and even where it's feasible, it might not be practicable.
So it's a value judgment, rather than an absolute rule.
cheers
[Back to original message]
|