Connecting Tech Pros Worldwide Forums | Help | Site Map

Puzzled by CSS Validator error on color mnemonic

Jonathan N. Little
Guest
 
Posts: n/a
#1: Jul 21 '05
When doing a final check on my stylesheets the CSS Validator flag lines
like this one as an error:
ADDRESS A { color: gold; }

Error is:
# Line: 31 Context : ADDRESS A

Invalid number : colorgold is not a color value : gold

Strangely if I change the style sheet to:
ADDRESS A { color: #FFD700; }

There is not error but gold==#FFD700, it is a valid color mnemonic, also
all the 'color: gold' entries where flagged but not when in a border
definition like:
..boxed { border: thin solid gold; }

nor with other colors like:
H1 { color: white; }?

I guess I can use #FFD700, but gold would be easier to recognize...

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

Michael Winter
Guest
 
Posts: n/a
#2: Jul 21 '05

re: Puzzled by CSS Validator error on color mnemonic


Jonathan N. Little wrote:

[snip]
[color=blue]
> There is not error but gold==#FFD700, it is a valid color mnemonic,[/color]

No it isn't. The color keywords are specified in section 4.3.6 -
Colors of the specification
(<URL:http://www.w3.org/TR/REC-CSS2/syndata.html#color-units>).
[color=blue]
> all the 'color: gold' entries where flagged but not when in a
> border definition like:
> ..boxed { border: thin solid gold; }[/color]

It's feasible that a previous error masked that one. I trust that one
of the two leading periods was a typo.
[color=blue]
> nor with other colors like: H1 { color: white; }?[/color]

That's because white is a valid keyword.
[color=blue]
> I guess I can use #FFD700, but gold would be easier to recognize...[/color]

You'll just have to manage.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Uncle Pirate
Guest
 
Posts: n/a
#3: Jul 21 '05

re: Puzzled by CSS Validator error on color mnemonic


Jonathan N. Little wrote:
[color=blue]
> When doing a final check on my stylesheets the CSS Validator flag lines
> like this one as an error:
> ADDRESS A { color: gold; }
>
> Error is:
> # Line: 31 Context : ADDRESS A
>
> Invalid number : colorgold is not a color value : gold[/color]

Correct. Check again; gold is not a valid color value.
[color=blue]
>
> Strangely if I change the style sheet to:
> ADDRESS A { color: #FFD700; }[/color]

Not strangely, #ffd700 is a valid color.
[color=blue]
>
> There is not error but gold==#FFD700, it is a valid color mnemonic, also
> all the 'color: gold' entries where flagged but not when in a border
> definition like:
> .boxed { border: thin solid gold; }[/color]

If that did not generate an error, you got unlucky in it not being
pointed out. Gold is NOT a valid color value.
[color=blue]
>
> nor with other colors like:
> H1 { color: white; }?[/color]

Of course it worked. White is one of the 16 valid color name/values.
[color=blue]
>
> I guess I can use #FFD700, but gold would be easier to recognize...
>[/color]

Perhaps a comment in your CSS file? You're stuck with #ffd700 since
gold is not valid.

--
Stan McCann "Uncle Pirate" http://stanmccann.us/pirate.html
Webmaster/Computer Center Manager, NMSU at Alamogordo
Coordinator, Tularosa Basin Chapter, ABATE of NM; AMA#758681; COBB
'94 1500 Vulcan (now wrecked) :( http://motorcyclefun.org/Dcp_2068c.jpg
A zest for living must include a willingness to die. - R.A. Heinlein
Jonathan N. Little
Guest
 
Posts: n/a
#4: Jul 21 '05

re: Puzzled by CSS Validator error on color mnemonic


Michael Winter wrote:
[color=blue]
> Jonathan N. Little wrote:
>
> [snip]
>[color=green]
>> There is not error but gold==#FFD700, it is a valid color mnemonic,[/color]
>
>
> No it isn't. The color keywords are specified in section 4.3.6 -
> Colors of the specification
> (<URL:http://www.w3.org/TR/REC-CSS2/syndata.html#color-units>)[/color]
Dang, you are correct! All the years, either it's senility setting in or
I am confusing it back with old Netscape browser spec ;-)
..[color=blue]
>[color=green]
>> all the 'color: gold' entries where flagged but not when in a
>> border definition like:[/color]
>[color=green]
> > ..boxed { border: thin solid gold; }[/color][/color]

Not in my code! Mine only has one '.'[color=blue]
>
> It's feasible that a previous error masked that one. I trust that one
> of the two leading periods was a typo.
>[color=green]
>> nor with other colors like: H1 { color: white; }?[/color]
>
>
> That's because white is a valid keyword.
>[color=green]
>> I guess I can use #FFD700, but gold would be easier to recognize...[/color]
>
>
> You'll just have to manage.
>
> Mike
>[/color]
Thanks, Yes I'll manage, I'll just have to review the spec and commit
the color names to memory!

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Jonathan N. Little
Guest
 
Posts: n/a
#5: Jul 21 '05

re: Puzzled by CSS Validator error on color mnemonic


Uncle Pirate wrote:
[color=blue]
> Jonathan N. Little wrote:
>[color=green]
>> When doing a final check on my stylesheets the CSS Validator flag
>> lines like this one as an error:
>> ADDRESS A { color: gold; }
>>
>> Error is:
>> # Line: 31 Context : ADDRESS A
>>
>> Invalid number : colorgold is not a color value : gold[/color]
>
>
> Correct. Check again; gold is not a valid color value.[/color]

Yep, thanks as in my other message I think I am confusing CSS color
names with old Netscape pre-CSS color names. Sometimes it is hard to
'unlearn' thins. I usually have no problem understanding hex color
values, maybe I'll just stick with them!

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Christoph Paeper
Guest
 
Posts: n/a
#6: Jul 21 '05

re: Puzzled by CSS Validator error on color mnemonic


*Jonathan N. Little* <lws4art@centralva.net>:[color=blue]
> # Line: 31 Context : ADDRESS A
>
> Invalid number : colorgold is not a color value : gold[/color]

(It's unbelievable that they still haven't put a space in there at the
obvious position. Nor deleted the ones before the colons.)
[color=blue]
> ADDRESS A { color: #FFD700; }[/color]

.... or "rgb(255, 215, 0)" or "rgb(100%, 84%, 0%)".
[color=blue]
> There is not error but gold==#FFD700, it is a valid color mnemonic,[/color]

Says who? Where do people learn this rubbish?
I can understand when someone is experimenting with color names and finds
'gold' to look somehow golden in some browsers, but I do not understand
expecting such a specific value.
[color=blue]
> all the 'color: gold' entries where flagged but not when in a border
> definition like:
> .boxed { border: thin solid gold; }[/color]

May be a bug in the CSS checker, but could be for another reason, too.
[color=blue]
> I guess I can use #FFD700, but gold would be easier to recognize...[/color]

The sad thing is, the stupid list of X11 color names was incorporated into
SVG and will thus almost for sure be included into CSS*3: Color. It holds
true: what comes from SVG or XSL into CSS is seldomly well designed.

--
The Hitchhiker's Guide to the Galaxy: "To summarize: It is a well-known fact
that those people who must want to rule people are, ipso facto, those least
suited to do it. To summarize the summary: Anyone capable of getting themselves
made President should by no means be allowed to do the job. To summarize the
summary of the summary: People are a problem."
Rijk van Geijtenbeek
Guest
 
Posts: n/a
#7: Jul 21 '05

re: Puzzled by CSS Validator error on color mnemonic


On Wed, 02 Feb 2005 21:13:44 +0100, Christoph Paeper
<christoph.paeper@nurfuerspam.de> wrote:

...
[color=blue]
> The sad thing is, the stupid list of X11 color names was incorporated
> into SVG and will thus almost for sure be included into CSS*3: Color. It
> holds true: what comes from SVG or XSL into CSS is seldomly well
> designed.[/color]

What's the problem, apart from most of the names being silly? Browsers
already support all the X11 color names, in CSS as well as in HTML
attributes.

--
Rijk van Geijtenbeek

The Web is a procrastination apparatus:
It can absorb as much time as is required to ensure that you
won't get any real work done. - J.Nielsen

Christoph Paeper
Guest
 
Posts: n/a
#8: Jul 21 '05

re: Puzzled by CSS Validator error on color mnemonic


*Rijk van Geijtenbeek* <rijk@operaremovethiz.com>:[color=blue]
> On Wed, 02 Feb 2005 21:13:44 +0100, Christoph Paeper[color=green]
>> The sad thing is, the stupid list of X11 color names was incorporated
>> into SVG and will thus almost for sure be included into CSS*3: Color.
>> It holds true: what comes from SVG or XSL into CSS is seldomly well
>> designed.[/color]
>
> What's the problem, apart from most of the names being silly?[/color]

That's the basic problem. They are partly strangely named and neither
systematic nor logic: 'darkgray', for example, is lighter than 'gray', but
at least darker than 'lightgrey'---SVG/CSS adds the missing gray/grey
variants, but we probably will never get 'colour' OTOH. What's worse:
their existence effectively hinders the introduction of a better system,
which deserves to be called one. I liked
<http://lists.w3.org/Archives/Public/www-style/2002May/0201.html>; WD2 of
the color module was published 19 Feb 2002, i.e. over three months
earlier, and already had the X11 (later: SVG) color keywords, but could
have been changed for the better still---now it's been a CR for over one
and a half year.
[color=blue]
> Browsers already support all the X11 color names, in CSS as well as in
> HTML attributes.[/color]

Opera, for instance, does not in all circumstances.

--
Reality is an illusion that occurs due to the lack of alcohol.
Closed Thread