CSS Typography Quick Reference


Conventions:

CSS Property : [coma-seperated list of possible values];
CSS Property : space-seperated list of sub-properties;

Code

font : font-style font-varient font-weight font-size font-family;
Example: font : italic small-caps bold 16px Veranda;
font-style : [italic, oblique, normal];
font-varient : [small-caps];
font-weight : [lighter, light, normal, bold, bolder];
font-weight : [100, 200, 300, 400, 500, 600, 700, 800, 900];

Defines line width, 400 same as normal, 700 same as bold.
font-size : [size in in absolute or relative measurements];
Absolute measurements include pixels, points, em, centimeters, and inches. Relative measurements include smaller, larger, or % of the parent element.
font-family : [coma-seperated list of specific font or generic family names];
Family name may need to be capitalized, or in quotes. More than one can be listed, and the first available on the user system will be used. See font-family examples for specific font familes.

color : [color name or hexadecimal RGB value];
text-transform : [uppercase, lowercase, capitalize];
text-decoration : [line-through, overline, underline, none];
word-spacing : [spacing size in pixels, points, em, centimeters, or inches];
letter-spacing : [spacing size in pixels, points, em, centimeters, or inches];
text-indent : [indentation size in absolute or relative measurements];
text-align : [left, right, center, justify];
text-shadow : offset-right offset-down blur-radius color;
Example: text-shadow : 3px 3px 5px black; This will create a black shadow 3 pixels down and 3 pixels to the right of the text, with a 5 pixel blur.
white-space : [normal, pre, nowrap];

Additional References:

CSS2 Specification [From www.w3.org] CSS Tutorial [From www.w3schools.com]

© 2003-2004