Notes on Color
17 colors
names on css2.1 (css2 had only 16) css2.1 added ORANGE
Color
values substitute color names. Color values are usually in hexadecimal
Color in hexadecimal is represented in pairs: 00 00 00
The first pair represent how much RED in the color value (00
determines no red color in such value)
The second pair represents GREEN (how much green is going to be mixed in to get the color we want).
The third pair represents how much BLUE in the color mix is going to be blue.
In short, these are our
RGB values.
If the two values in the pair are the same number, CSS allow us to create a shorthand.
In our example the shorthand would be written as such: 0 0 0 (spaces don't matter, I'm writing spaces only for illustration purposes. The CSS color value should actually be 000000 or 000 )
To be safe, don't forget the
; at the end: 000; or 000000;
It is good to know that all the colors considered 'web-safe' (the famous 216 colors) can be written as a shorthand which makes such shorthand very popular in web design.
It is worth noting however that today's computers allow us to use other than 'web-safe' colors (actually millions of possibilities) and the use of 'web-safe' colors is no longer an important issue. There are other more important considerations when choosing colors, such as contrast and many other creative variants.
In my understanding, the only reason to consider 'web-safe' colors nowadays is if we are designing a 'vanilla' type software that may be modified by some one else such as a webmaster or a power user. In that case a 'web-safe' color pallet makes sense because it makes it more universal and avoids dithering. They always give a nice smooth color on web pages and in graphics.
-----------
Links must be styled in the proper order of them to be able to work. Here's a way of remembering which ones get styled first:
L link
O
V visited
E
H hover
A active (focus)
T
E
--------------------------- example:
a:link { color : #000;}
a:visited {color : #fff;}
a:hover { background-color : yellow; color : #000; text-decoration : none;}
a:active, a:focus {background-color "#91325d; color : #fff; text-decoration : none;}
Further reading:
Wikipedia - This is a great overall explanation of colors for the web taking also in consideration web-print combination
W3Schools : A must have code reference.