473,395 Members | 1,584 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Color properties on columns is valid CSS syntax ?


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
5 1956
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Johannes | last post by:
Hi there, i would like to write a control which contains several complex properties. One of these properties should contain a string and a collection of other objects. to describe it declarativle...
8
by: Joel Reinford | last post by:
I would like to build a class that has properties which can be accessed by string names or index numbers in the form of MyClass.Item("LastName"). The string names or item index values would be...
1
by: Hexman | last post by:
I'm creating a new Access table using ADOX. I can add columns and indexes, but I'm baffled on how to change field properties. Can someone give me a hand? Want to change properties such as:...
0
by: todd.freed | last post by:
Hello. I'll make this quick - its quite a conundrum I have the following markup <MyNS:MyControl runat="server" id="myId" CustomProperty1="value" CustomProperty1="value"...
47
by: Jon Slaughter | last post by:
private string name; public string Name { get { return name; } set { name = value; } } In the above, why doesn't C# just allow one to create a single directive to make a property?
13
by: lithoman | last post by:
I'm stumped here. I run the procedure Batch_Select against the database with @ID=18 and I get the expected data. When it loads into a SqlDataReader, it gets messed up somehow. Initially, after the...
4
by: beatdream | last post by:
I am designing a database to handle different kinds of products ... and these products can have different properties...for example, a trouser can be specified by the width, length, color, and other...
17
by: David C. Ullrich | last post by:
Having a hard time phrasing this in the form of a question... The other day I saw a thread where someone asked about overrideable properties and nobody offered the advice that properties are...
26
by: Max2006 | last post by:
Hi, C# 3.0 extension methods become useful for us. Do we have the similar concept for extension properties? Thank you, Max
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.