473,320 Members | 1,936 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,320 software developers and data experts.

Puzzled by CSS Validator error on color mnemonic

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
Jul 21 '05 #1
7 3343
Jonathan N. Little wrote:

[snip]
There is not error but gold==#FFD700, it is a valid color mnemonic,
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>).
all the 'color: gold' entries where flagged but not when in a
border definition like:
..boxed { border: thin solid gold; }
It's feasible that a previous error masked that one. I trust that one
of the two leading periods was a typo.
nor with other colors like: H1 { color: white; }?
That's because white is a valid keyword.
I guess I can use #FFD700, but gold would be easier to recognize...


You'll just have to manage.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 21 '05 #2
Jonathan N. Little wrote:
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
Correct. Check again; gold is not a valid color value.

Strangely if I change the style sheet to:
ADDRESS A { color: #FFD700; }
Not strangely, #ffd700 is a valid color.

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; }
If that did not generate an error, you got unlucky in it not being
pointed out. Gold is NOT a valid color value.

nor with other colors like:
H1 { color: white; }?
Of course it worked. White is one of the 16 valid color name/values.

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


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
Jul 21 '05 #3
Michael Winter wrote:
Jonathan N. Little wrote:

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

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>)

Dang, you are correct! All the years, either it's senility setting in or
I am confusing it back with old Netscape browser spec ;-)
..
all the 'color: gold' entries where flagged but not when in a
border definition like:
> ..boxed { border: thin solid gold; }


Not in my code! Mine only has one '.'
It's feasible that a previous error masked that one. I trust that one
of the two leading periods was a typo.
nor with other colors like: H1 { color: white; }?

That's because white is a valid keyword.
I guess I can use #FFD700, but gold would be easier to recognize...

You'll just have to manage.

Mike

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
Jul 21 '05 #4
Uncle Pirate wrote:
Jonathan N. Little wrote:
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

Correct. Check again; gold is not a valid color value.


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
Jul 21 '05 #5
*Jonathan N. Little* <lw*****@centralva.net>:
# Line: 31 Context : ADDRESS A

Invalid number : colorgold is not a color value : gold
(It's unbelievable that they still haven't put a space in there at the
obvious position. Nor deleted the ones before the colons.)
ADDRESS A { color: #FFD700; }
.... or "rgb(255, 215, 0)" or "rgb(100%, 84%, 0%)".
There is not error but gold==#FFD700, it is a valid color mnemonic,
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.
all the 'color: gold' entries where flagged but not when in a border
definition like:
.boxed { border: thin solid gold; }
May be a bug in the CSS checker, but could be for another reason, too.
I guess I can use #FFD700, but gold would be easier to recognize...


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."
Jul 21 '05 #6
On Wed, 02 Feb 2005 21:13:44 +0100, Christoph Paeper
<ch**************@nurfuerspam.de> wrote:

...
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.


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

Jul 21 '05 #7
*Rijk van Geijtenbeek* <ri**@operaremovethiz.com>:
On Wed, 02 Feb 2005 21:13:44 +0100, Christoph Paeper
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.
What's the problem, apart from most of the names being silly?


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.
Browsers already support all the X11 color names, in CSS as well as in
HTML attributes.


Opera, for instance, does not in all circumstances.

--
Reality is an illusion that occurs due to the lack of alcohol.
Jul 21 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Spartanicus | last post by:
The document at http://homepage.ntlworld.com/spartanicus/custom_dtd.htm uses a custom DTD, the w3c validator validates it but with this warning: "Unknown Parse Mode! The MIME Media Type...
0
by: Valerie Hough | last post by:
I have derived a class from MenuItem so that I can associate IDs of my choosing with each item (a la C++). I have created a ContextMenu in the constructor of an owner draw list box and added a...
8
by: pmud | last post by:
Hi, I am using a compare validator in asp.net application(c# code). This Custom validator is used for comparing a value enterd by the user against the primary key in the SQL database. IF the...
1
by: bennett | last post by:
At http://www.brainjammer.com/testing/validator_test.aspx I have a text field where you can enter text, and a button where if you click the button, it sets the value of a label below it, to...
3
by: tshad | last post by:
I have a page that is very long so I have set it up to page using <div> to display or hide the different pages. When I get to the last page the user submits the page. This works great, except...
40
by: VK | last post by:
Hi, After the response on my request from W3C I'm still unclear about Tidy vs. Validator discrepansies. That started with <IFRAME> issue, but there is more as I know. Anyway, this very basic...
5
by: intrader | last post by:
The code is: <code> namespace ConsoleApp { public interface Ivalidator{ String ErrorMessage{get;} Boolean IsValid{get;} void Validate(string value,long mask, long maxLength,string...
60
by: aarklon | last post by:
Hi all, Is there any mnemonic for remembering C precedence rules???? I have just coined the word TUBSREBLCAC where T --- top level operators U ---- unary operators B ----- binary...
39
by: jacob navia | last post by:
Mnemonic means trying to remember. Mnemonic means making annotations that remind you. Speaking about mnemonic I saw this message. Tor Rustad wrote: One of the problems with old people is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.