The Parts of a CSS Rule

Part of the CSS Web Design For Dummies Cheat Sheet

The following figure shows the parts of a CSS rule. This rule says, "Display in red the text of any paragraph <p> in the document with a class name attribute alert."

image0.jpg

You can make up any name for the class name (the writer of the preceding code chose alert), but the name in the CSS rule must match the name later used in the HTML attribute.

The following tables display common CSS properties and values.

Units of Measure
px pixels
em M-width
pt point
in inches
mm millimeter
cm centimeter
pc picas
ex x-height
The Font Properties
font
font-family
font size
font style
font variant
font weight
The Text Properties
letter spacing
word-spacing
line-height
vertical-align
text-align
text-decoration
text-indent
text-transform
The Border Properties
border-top-color
border-right-color
border-left-color
border-bottom-color
border-top-style
border-right-style
border-left-style
border-bottom-style
The Positioning Properties
position
top
bottom
right
display
clear
z-index
blog comments powered by Disqus

SERIES
CSS Web Design For Dummies Cheat Sheet

Advertisement

Inside Dummies.com