Css Validator Kaflooey?

E

Edwin van der Vaart

Alan said:
Your CSS is unwise. For safe cascading, one should specify a definite
colour for both properties - or for neither.
Changed the background colour to #ff0. Still the validator complains
about "you have no background-color with your color".
 
A

Alan J. Flavell

Changed the background colour to #ff0. Still the validator complains about
"you have no background-color with your color".

We need this in context, I think. Do you have a URL?

Your personal home page has, I see (copied from the CSS checker report):

#tekst a:link, #tekst a:visited {
* color : #f00;
* background : transparent;
}

which has provoked the warning:

Line : 108 (Level : 1) You have no background-color with your color :
#tekst a:visited


but you earlier have:

#tekst {
* float : left;
* background : #fffff0;
* width : 63%;
* margin-left : 1.5em;
}

which provoked:

Line : 61 (Level : 1) You have no color with your background-color :
#tekst


Seems to me the later warning could be a knock-on effect of the earlier
one.

Do you have a URL which demonstrates the effect you're complaining
about and *nothing* else?
 
E

Edwin van der Vaart

Alan said:
We need this in context, I think. Do you have a URL?

Your personal home page has, I see (copied from the CSS checker report):

#tekst a:link, #tekst a:visited {
* color : #f00;
* background : transparent;
}

which has provoked the warning:

Line : 108 (Level : 1) You have no background-color with your color :
#tekst a:visited


but you earlier have:

#tekst {
* float : left;
* background : #fffff0;
* width : 63%;
* margin-left : 1.5em;
}

which provoked:

Line : 61 (Level : 1) You have no color with your background-color :
#tekst


Seems to me the later warning could be a knock-on effect of the earlier
one.

Do you have a URL which demonstrates the effect you're complaining
about and *nothing* else?
Only a local redesign page. Sorry.
--
Edwin van der Vaart
http://www.semi-conductor.nl/ Links to Semiconductors sites
http://www.evandervaart.nl/ Persoonlijke website
Explicitly no permission given to Forum4Designers and issociate.de to
duplicate this post.
 
K

kchayka

Alan said:
Your CSS is unwise. For safe cascading, one should specify a definite
colour for both properties - or for neither.

The CSS wouldn't be unwise if:
#title { color: #000; background: #fff url(img.png); }

Assuming the foreground colors contrast acceptably with img.png, of
course. They do contrast with #fff.
 
D

Dr Clue

Alan said:
No point in investing a lot of effort to overturn one's site which already
conforms to specification and isn't provoking some known bug in browsers
etc. - if they temporarily provoke a bug in a CSS syntax checker, then
don't panic, check the specs and be happy. The fact that some software
tools come from the W3C is no guarantee of perfection, you know.


This is true, and on top of that, there can be things like server
settings and the like that can trip up the checker.

For example my front page does not validate , but in the same breath
the w3c validator says there are no errors either.

I tracked it down to my use of XHTML and my homebrew DTD vs.
the content-type the server puts out on my hosted site.
should be something like text/xhtml-xml or some such thing,
but I aint loosing any sleep over it.

Glad to see you again Alan
--
--.
--=<> Dr. Clue (A.K.A. Ian A. Storms) <>=-- C++,HTML, CSS,Javascript
--=<> http://resume.drclue.net <>=-- AJAX, SOAP, XML, HTTP
--=<> http://www.drclue.net <>=-- SERVLETS,TCP/IP, SQL
--.
 
A

Alan J. Flavell

The CSS wouldn't be unwise if:
#title { color: #000; background: #fff url(img.png); }

Assuming the foreground colors contrast acceptably with img.png, of
course. They do contrast with #fff.

No, it's about *Cascading*: you can't just look at the one stylesheet and
reckon the job complete - in general you've got to consider cascading with
a stylesheet not under the author's control (for example a user
stylesheet; or one imposed by the corporate guidelines, which might
change).

With "transparent" on the overlying element, the colour that will shine
through from an underlying element is the b.g.colour that results after
the cascade has been done. You don't in general know what that is, and it
might not contrast with your choice of text colour.

To be sure that there will always be a contrast, and text therefore
visible, the guideline is that every property should specify a definite
colour either for both properties or neither. That's true for every
stylesheet which participates in the cascade. And that's IMHO what the
W3C checker is advising you about.

Mixing "transparent" or "inherit" with definite colours does *not* satisfy
the requirements of this logic. If you think about it, that should be
obvious.

On the real web, many stylesheets disregard this advice, it's true, and
so, cascading an !important user stylesheet with author stylesheets on
real web pages can be hairy anyway. But if we're going to talk about it
at all, we might as well try to get the issues straight, IMHO. I've set
out my best understanding, and this is a problem which AIUI exists even
without background images. Those are an *additional* complicating factor.
 
E

Edwin van der Vaart

Neredbojias said:
With neither quill nor qualm, Edwin van der Vaart quothed:

Huh? Maybe all is not well in w3c heaven... Of course technically
speaking, "transparent" is not a color...

(It's a joke, don't blow your wig in the canal.)
(lol)
 
E

Edwin van der Vaart

Alan said:
Your CSS is unwise. For safe cascading, one should specify a definite
colour for both properties - or for neither.

Specifying background: transparent is, logically, only safe in conjunction
with specifying color: inherit.

Whether this is the motivation for the CSS checker's report, I don't know
("transparent" is the default anyway), but it's good advice nevertheless.
That's assuming you care about cascading with some other stylesheet (e.g
belonging to the user) that's not under your control. You /should/ care,
but it's your choice really.
With other words.
You always specify a background colour with a font colour for e.g.
headlines, even when you have already specified a font- and a background
colour for the <body>.

I normally use to know. You can use a transparent background for e.g.
headlines, when you already have specified a background colour for the
<body>.
 
K

kchayka

Alan said:
you can't just look at the one stylesheet and
reckon the job complete - in general you've got to consider cascading with
a stylesheet not under the author's control

I won't argue that, but you can't ignore the graphic design aspect of
the cascade. Setting background colors and images that show through to
child elements, while using different foreground colors on those
children, is going to happen. To say it shouldn't be done is to say
poo-poo to any graphic design at all. That isn't going to happen, nor
should it.

Regardless, an author cannot predict what user rules might be thrown
into the mix, nor is it realistic to even try - it makes my head swim
even thinking of all the possibilities. IMO, if a user invokes their own
stylesheet, it is their responsibility to make sure they set both
foreground and background colors, as well as !important rules. You can't
blame the author for the user's mistakes.
 
A

Alan J. Flavell

I won't argue that, but you can't ignore the graphic design aspect of
the cascade. Setting background colors and images that show through to
child elements, while using different foreground colors on those
children, is going to happen.

I'm sorry if you got the impression that I, personally, was trying to stop
anyone from doing that! I'm just trying to present what I understand to
be the logic behind this issue - why the checker is reporting what it's
reporting, and hoping to help folks understand the principles behind it,
so that they can get from it any benefit that can be had.

As far as "background colours shining through": if you set the background
colour for the underlying element, then you'll have no problem
re-specifying it for the overlying element, and the result will look the
same, if it's not cascaded with a contradictory stylesheet. But when a
design -is- cascaded with a contradictory stylesheet, surely the first
priority is that content is still, at least, visible, and preferably,
readable? If that can be done without impairing the original design, why
not go for it? That's all that I'm saying.

On the other hand, you've raised an interesting point regarding background
images. If they are re-specified for the overlying element, then there's
no guarantee that they'll line-up with the underlying element, which
*could* be a motive for using transparency. On the other hand, displaying
text over a background image turns out all too often to be an unreadable
mess on some reader's screens. Maybe the background image is best
confined to the underlying canvas, and the overlying element with its text
better displayed against a tasteful plain colour. But that's a decision
that the designer has to take, not me. I'm just asking them to make an
*informed* decision, based on known properties of the medium.
To say it shouldn't be done is to say
poo-poo to any graphic design at all. That isn't going to happen, nor
should it.

What I'm saying is: understand the properties of the medium before taking
decisions. And this aspect of the cascade is part of understanding the
properties of the medium.
Regardless, an author cannot predict what user rules might be thrown
into the mix, nor is it realistic to even try - it makes my head swim
even thinking of all the possibilities.

There's also the scenario of the mandatory corporate stylesheet, with
individual designers only allowed to cascade with it, not to amend it.

OK, I can't point you to an actual instance yet, but something like that
is sure to happen, in places, it seems to me.
IMO, if a user invokes their own stylesheet, it is their responsibility
to make sure they set both foreground and background colors,

Yes, just as much so as it's the designer's responsibility to do the same.
The logic only works if all the participants play by those rules.
as well as !important rules. You can't blame the author for the user's
mistakes.

Equally, you can't blame the user for the author's mistakes. But when
push comes to shove, the user has the last word: if they can see that the
cascade is going amiss, they can turn off the author's styles altogether.
Seems to me that a clever author would want to avoid that happening, by
doing whatever was possible to make the user's "ultimate sanction"
unnecessary. If you see what I mean.

But at bottom, the final decision isn't mine, it's the author's. I say
again: I just want their decisions to be taken on the basis of
understanding the properties of their medium, rather than insisting (as
we've surely seen all too often?) that they want to "force" it to look
pixel-exactly like their paper draft.

all the best
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top