2010-07-03

CSS color names

Using color names is obviously easier than by number, gray vs rgb(128, 128, 128). Besides less typing, using names makes it easier to use the same consistently across multiple places in your CSS code.

Strictly speaking the CSS 2.x specs recognize only 17 names: The same 16 color names as HTML, plus 'orange' rgb( 255, 165, 000).

CSS 3 (not yet finalized) adopts the long list of color names defined long ago by X11

Virtually all browsers recognize these color names now. But those color names will show up as errors in CSS 2.x validators. An error may appear as this:
Value Error : background-color lavender is not a color value : lavender lavender
Here's the big tip… A list of X11 colors organized by color groups. Much easier to find your desired color than in the other alphabetical and numerical lists I’ve seen.

No comments:

Post a Comment