Forum Moderators: not2easy

Message Too Old, No Replies

Color validation

antiquewhite passes for one site, but not for another

         

D_Blackwell

1:02 am on Aug 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I validated the CSS for one of my sites with the W3C validator. "firebrick" was flagged so I fixed it with #900. To my surprise, "antiquewhite" got by.

I fixed and validated another site and "antiquewhite" was repeatedly flagged. Both sites use it extensively. I don't see a "safe" color that is close to it, so I may have to make some choices there.

My main question is why it validated for one site and was flagged for the other?

My follow-up question is 'Can I use any hexadecimal code and validate, or do I have to (or should I) stick with the "safe" colors'?.

toothfish

1:45 am on Aug 10, 2003 (gmt 0)

10+ Year Member



Both firebrick and antiquewhite have hex equivalents, I guarantee it. They may be something like #dd3333 and #ffffee respectively, so all you have to do is find them and insert the color codes. If they're not "safe" then I think a color display which can't handle them will interpolate the closest equivalent (#c33 and #fff).

toothfish

1:49 am on Aug 10, 2003 (gmt 0)

10+ Year Member



Remember you can also use RGB values to specify color:

EM { color: rgb(255,0,0) }

pageoneresults

3:03 am on Aug 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



firebrick - color:#b22222;
antiquewhite - color:#faebd7;

It is recommended that you use a hex or rgb value for your color attributes. Named colors have been known to cause issues with certain browsers.

Do a search for "named colors" in your favorite SE, that should turn up all the information you are looking for in reference to named colors. Here is one from the W3C...

6.5 Colors [w3.org]

According to the W3C, there are 16 standard color names supported.

For more information and a complete listing of all named color values, check out the MSDN Library...

Using Named Colors in Internet Explorer [msdn.microsoft.com]

D_Blackwell

4:00 am on Aug 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks. I was careless in using named colors outside the 16 CSS approved. Named colors are just so handy to use.

I remain curious though about why the W3C validated the usage of "antiquewhite" on one site but not the other. I looked the other way when the first one validated. Now, I'm going to go back and "fix" it anyway.

chiyo

4:06 am on Aug 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Youve lost me here. I only thought there was 16 colors you could actually "name", and as pageonereseults says, it still is better to use the hex or RGB equivelnts.

Can anybody direct me to what docs mention "firebrick" and "antique white" or maybe this is a terminology used in Dream Weaver or Front Page or one of the other web code writing assistants? But in that case the validator would not have recognized it so i guess somehwhere there is an official table with these other named colors and the hex/RGB values they represent?

MonkeeSage

4:17 am on Aug 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



http:*//www.okako.com/~imai/webColor/index.cgi?antiquewhite
http:*//www.okako.com/~imai/webColor/index.cgi?firebrick

^^ I think they are the aliases for the (unsafe?) 256 color palatte vs. the 16 color 'web safe' palatte.

Jordan

D_Blackwell

4:58 am on Aug 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I hope that I haven't confused by own question. There are only 16 approved CSS named colors, but that didn't stop me from using some names that I've found to be in common use. For validation purposes, I want to get away from using non-approved names. But I have a site where the W3C validator allowed "antiquewhite" as a color value. So, I'm confused as to why?

[turtlefeathers.com...]

This style sheet validates everytime, yet I've used "antiquewhite" as a color value numerous times. (Please overlook the obvious bloat in this document.)

What am I missing? One way or another, I'm wrong. I always am.

chiyo

5:25 am on Aug 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi D blackwell and thanks all. Sorry if i went off topic. I was just wondering whether these named colors like "antique white" were part of any "official spec" from w3C or other authoritative standard, or were part of WYSIWIG editor "terms" that have come into common use, or have definate meanings for graphic artists (say in Photoshop)

tedster

5:37 am on Aug 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That's a weird one. The only thing I can think of is that you've confused the validator somehow by also using antiquewhite as a class name for a paragraph. But no matter the reason, your validator results are definitely not accurate.

D_Blackwell

6:32 am on Aug 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I renamed the paragraph here and revalidated by upload. It still passes despite having "antiquewhite" all over the place.

Since I know that it is not right I'm going to replace all references with a yet to be decided upon hex#, but I remain confused. Maybe this is just one of those 'It's a mystery' type things. Had the second site not come up with errors, I probably would have just let it go and forgotten about it, even though I knew something wasn't quite right.

Marshall

9:31 am on Aug 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Would it not be simpler and more uniform across browsers to use a background image say 10x10 pixels the exact color you want? At 10x10, it will have a negligible effect on load time.