Web Color Shorthand
August 28th, 2007
Using Short Versions of Color Codes in CSS
Once you’ve started using CSS layouts for your Web designs, you may notice something odd about the way the colors are defined. Rather than the standard 6-character long code after the pound sign (#cc99ff), instead you see just three characters (#c9f). This is called color shorthand and it takes advantage of the fact that the browser-safe Web palette uses triplets that are always doubled. In other words, each color triplet is made of 3 pairs of characters 0-f (base 16), and with browser-safe colors they are doubled. So, to write color shorthand, you simply remove the duplicate character.
For example:
- White is written
#fff
- Black is written
#000
- Red is
#f00
- Green is
#0f0
- Blue is
#00f
and so on…
by About.com/

Foundations of Ajax

















Prima pagina



Comentarii
Trebuie sa fi autentificat pentru a adauga un comentariu.