Learn CSS, Manipulating Colors (Page 1 of 5 )
In the thrid part of this series still covering CSS Basics, Michael Youssef discusses manipulating colors in CSS. He also takes a brief look at the hexadecimal number system and how it's useful with color values. He also defines the meaning of a keyword and the Hexadecimal number system.
Colors can change the way your websites look, and your users form a first impression from the colors you use. So even if your content is very unique, bad colors will mean fewer users. In fact, understanding and manipulating colors is a broad artistic topic that fills books, but we will focus on what we need to for CSS.
Using Colors by keywords
CSS can define colors by name, so you can directly use this name instead of RGB values. For instance, you can use "red" instead of the RGB value (255, 0, 0). The declaration would look like background-color: red. I will talk more about RGB colors shortly. The CSS 2.1 Specifications define 17 named colors: black, silver, gray, navy, blue, aqua, teal, purple, fuchsia, white, lime, green, maroon, red, orange, yellow and oliver. You can take a look at the colors on W3C website CSS 2.1 Specifications (http://www.w3.org/TR/CSS21/syndata.html#color-units).
These colors are fine but still we need more named colors so the CSS 3.0 Specifications has defined 147 named colors which you can take a look at the CSS 3.0 Specifications http://www.w3.org/TR/2003/CR-css3-color-20030514/. Let's take a look at an example on the next page.
Next: Keywords >>
More Style Sheets Articles
More By Michael Youssef