By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,625 Members | 2,261 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,625 IT Pros & Developers. It's quick & easy.

Color properties on columns is valid CSS syntax ?

P: n/a

Hello

I have found in CSS2 specification that the color of table columns is not
specificaly affected by setting the color property on COL elements (unlike
width, for example). Now this table here:

http://web.ss.pub.ro/~bat/HelloWorld.php

has a blue column in IE6.0 and a black one in Netscape 7.1.
I validated my CSS (with online CSS validator) and it gave me no warning.
Now why is that ?

Which one of the CSS validator, IE6.0 and Nestcape 7.1 is buggy ?
I'm sorry to say I tend to blame the CSS validator ...

--
Thank you
Timothy Madden
---------------------------
And I don't wanna miss a thing
Jul 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Els
Timothy Madden wrote:
Hello

I have found in CSS2 specification that the color of table columns is not
specificaly affected by setting the color property on COL elements (unlike
width, for example). Now this table here:

http://web.ss.pub.ro/~bat/HelloWorld.php

has a blue column in IE6.0 and a black one in Netscape 7.1.
I validated my CSS (with online CSS validator) and it gave me no warning.
Now why is that ?

Which one of the CSS validator, IE6.0 and Nestcape 7.1 is buggy ?
I'm sorry to say I tend to blame the CSS validator ...


According to the specs
http://www.w3.org/TR/REC-CSS2/colors.html#propdef-color
colors apply to all elements, so I'd say Netscape is failing.

OTOH the colour remains black not only in Netscape, but also
in Opera and Firefox, which would mean only IE gets it
right... Is that possible?
--
Els

Mente humana é como pára-quedas; funciona melhor aberta.

Jul 20 '05 #2

P: n/a
Timothy Madden <ba****@rmv.spam.home.ro> wrote:
I have found in CSS2 specification that the color of table columns
is not specificaly affected by setting the color property on COL
elements (unlike width, for example).
By the specification, it does not affect the color at all. Many people
think this is very unfortunate, and some people think there's a good
explanation to this. Meanwhile, the pragmatist uses a class attribute
in each and every cell, in order to be able to style a table well.
http://web.ss.pub.ro/~bat/HelloWorld.php

has a blue column in IE6.0 and a black one in Netscape 7.1.
The latter is the rendering that conforms to the specification.
No big surprise, really?
I validated my CSS (with online CSS validator) and it gave me no
warning. Now why is that ?
You have unrealistic expectations on what the "CSS validator" does.
It's simply a syntax checker with a handful of other checks too, meant
to detect potential practical problems.

There is no syntax error in

COL#frstcol {color: blue; }

though a good checker would issue a warning about not setting
background when you set color (the WDG CSS checker does, but it is
otherwise limited). A CSS checker has no way of knowing that this rule
will refer to an element that will be displayed as table column and
that therefore the rule will have no effect on conforming browsers.
(Admittedly a checker could, in some situations, peek at the HTML
markup, if available, and use information that says that probably col
elements are by default rendered as columns. But that's really beyond
the job of a CSS checker. After all, the style sheet could be written
for a YuccaML document where COL means Cool Oriental List.)

(Didn't you notice the error message about width: '100%', by the way?)
Which one of the CSS validator, IE6.0 and Nestcape 7.1 is buggy ?
All of them, of course. Any nontrivial program has bugs.
I'm sorry to say I tend to blame the CSS validator ...


Please feel free to do so. They deserve that as long as they have such
a misleading name for it. But it's actually a useful, almost
indispensable tool - you just need to understand what it does, and what
it does not do.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #3

P: n/a
Els wrote:
Timothy Madden wrote:
I have found in CSS2 specification that the color of table columns is not
specificaly affected by setting the color property on COL elements (unlike
width, for example).


According to the specs
http://www.w3.org/TR/REC-CSS2/colors.html#propdef-color
colors apply to all elements, so I'd say Netscape is failing.


It's not that the property does not apply to the element. Actualy I know
the syntax is strictly speaking valid, but it doesn't really affect the
column's color, it has no semantic meaning.
Jul 20 '05 #4

P: n/a
Jukka K. Korpela wrote:
Timothy Madden <ba****@rmv.spam.home.ro> wrote:
I have found in CSS2 specification that the color of table columns
is not specificaly affected by setting the color property on COL
elements (unlike width, for example).
By the specification, it does not affect the color at all. Many people
think this is very unfortunate, and some people think there's a good
explanation to this.


I would very much like to know what could this good explanation be ?
After all, the style sheet could be written
for a YuccaML document where COL means Cool Oriental List.)
Ok, I didn't think about that. This actualy makes the validator all OK.
Still it would be nice if it would ask me about document language and do a
real check of the stylesheet..
(Didn't you notice the error message about width: '100%', by the way?)

Yeah, sorry. I had played around with the file bit before uploading it.
However percentage values are legal in width propertis, I still don't
understand what's wrong
(http://www.w3.org/TR/REC-CSS2/visude...width-property)
Jul 20 '05 #5

P: n/a
Timothy Madden wrote:
By the specification, it does not affect the color at all. Many people
think this is very unfortunate, and some people think there's a good
explanation to this.

And some people think both :)
I would very much like to know what could this good explanation be ?


http://ln.hixie.ch/?start=1070385285&count=1

--
David Dorward <http://dorward.me.uk/>
Jul 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.