W3C home > Mailing lists > Public > www-validator@w3.org > September 2007

Re: use of colornames & validation

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Tue, 4 Sep 2007 16:20:01 +0300 (EEST)
To: "NOWAR.MEANS.PEACE@GMAIL" <nowar.means.peace@gmail.com>
cc: www-validator@w3.org
Message-ID: <Pine.SOC.4.64.0709041616040.17569@hopeatilhi.cs.tut.fi>

On Tue, 4 Sep 2007, NOWAR.MEANS.PEACE@GMAIL wrote:

> On the next w3schools page I got the following information about the 
> use of color-names

w3schools is not an authoritative source of information. Many people think 
that it is not reliable either (and often back this up by pointing out 
specific errors).

> Note: If you want your pages to validate with an HTML or a CSS validator, W3C has listed 16 color names that you can use:
> aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow.
> If you want to use other colors, you must specify their RGB or HEX value.

That's misleading in more ways than I care to list down.

> So, how come that when a colorname that is NOT in the 16-list is used, the w3c html-validator still validates the page,
> instead of coming up with an error ??

This part is simple and basically the same as with href attribute values. 
The COLOR and BGCOLOR attributes in HTML are declared as CDATA attributes. 
You can write color="hello world!" or color=")-/%?/%", and it is _valid_ 
but not _correct_. That is, it is incorrect in a manner that is not 
described in the formal syntax that a validator operates on.

Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/
Received on Tuesday, 4 September 2007 13:20:15 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:59:04 UTC