CSS Reference
Appendix D
CSS Mini Reference
This appendix is a ha ndy list of some of the most useful CSS proper ties, pseudo-
elements, and pseudo-classes. Mainly they are older and well-establishe d properties,
but included are also some of the CSS3 properties th at are well supported by mod-
ern browsers. If you want to p lunge deeper into CSS, there exist many exhaustive
sources that you might want to look at. For example,
CSS3 by D. S. McFarland,
or
developer.mozilla.org/en-U S/docs/CSS/CSS_Reference. For fu ll de ta ils about the
latest CSS specification right from the horse’s mouth , visit the World Wide Web Con-
sortium at
www.w3.org/Style/CSS/current-work.
D.1 CSS Data Types
Each CSS declaration consists of a property name and a correspond ing value. Value s
are categorized according to CSS data types, some of which are described in this
section.
<color> Data Type
The <color > CSS data type is used to specify a color. Most usually, a color is assigned
to f onts, borders (inc luding shadows), and back grounds. A color can be sp ecified
either by using one of the available keywords, or by using the RGB model, which
allows you to mix red, green, and b lue components to get a color of your liking.
Color Keywords
You can specify color directly by its name using a color keyword. Color keywords
are case-insensitive. Although there are more of them, only 17 color names are cur-
rently under sto od by all browsers: aqua, black, blu e, fuchsia, g ray, green, lime ,
maroon, navy, olive, orang e, purple, red, silver, teal, white, and yellow.
Note that none of the colors defined by keywords can have any transparency. If you
want to use transparent colors, then you must use the rgba() fun ction.
A special color keyword is the transparent keyword, which represents a fully trans-
parent color. Technically, this is a b la ck color having the alpha chann el set to its lowest
value and it is equivalent to rgba(0, 0, 0, 0).
339