Page 1 of 1

Should one use "black" or "#000"?

Posted: Fri May 20, 2005 10:15 pm
by Ambush Commander
I know this sounds a bit absurd, but I'd be really interested if there was a real answer. In CSS color attributes like color: or background-color:, is it preferable to use a hexadecimal value (#000) or a keyword (black)?

On one hand, one is more readable. On the other hand, the other is far more specific, won't do anything weird, and, most of the time, takes up less bytes.

Or is this whole question irrelevant?

Posted: Fri May 20, 2005 11:29 pm
by method_man
i prefer just using the color name lol
its much easier

Re: Should one use "black" or "#000"?

Posted: Sat May 21, 2005 12:56 am
by Roja
Ambush Commander wrote:I know this sounds a bit absurd, but I'd be really interested if there was a real answer. In CSS color attributes like color: or background-color:, is it preferable to use a hexadecimal value (#000) or a keyword (black)?
Of course there is an answer. These are the type of people that write standards that include how many PIXELS specific FONTS should shift when tables meet layers meeting div's.. you get the idea. They dictate everything under the sun. :)
WebStandard wrote: There are sixteen (16) legal color names for use in HTML 4.x and XHTML. Any other color name is a browser-specific name and cannot be used in conforming HTML 4.x and XHTML documents.
Now, with that out of the way, yes, short hex code colors are also shorter (less bandwidth), better supported (all the way back to NS4), AND make it easier to avoid using non-websafe colors (most of the 3-digit codes are websafe).

Posted: Sat May 21, 2005 7:34 am
by vigge89
As using hexcodes is much more flexible, and I want to keep the structure of everything, I just use hexadecimal codes. Imo, they're easier to examine, as you see the different aspects of colors and not just a name which doesn't say anything :)

Posted: Sat May 21, 2005 12:36 pm
by John Cartwright
I don't even see hex, I see the color :wink:

(yes, like The Matrix)

Posted: Sat May 21, 2005 12:42 pm
by Ambush Commander
Well then, Hexadecimal it is. It's what I used in the past anyway.