CSS 2.1 Help Cheat Sheet
CSS 2.1 Help Cheat Sheet
class String preceded by a full stop (.) border-color Colour of the border :hover
:active
ID String preceded by a hash (#)
Position :focus
div Formats structure or block of text :link
clear If any floating elements around the element :visited
span Inline formatting
both, left, right, none :first-line
color Foreground colour
float Floats to a specified side :first-letter
cursor Appearance of the cursor left, right, none
display block; inline; list-item; none left The left position of an element Media Types
overflow How to handle content that auto, length values [pt, in, cm, px] all
overflows its box. top The top position of an element braille
visible; hidden; scroll; auto auto, length values [pt, in, cm, px] embossed
visibility visible; hidden position static, relative, absolute handheld
print
z-index Above or below overlapping elements projection
Font auto, integer [higher numbers on top] screen
font-style italic, normal speech
font-variant normal, small-caps Background tty
background-color Colour of background tv
font-weight bold, normal, lighter, bolder, background-image Background image url(’’)
integer [100-900]
Units
background-repeat repeat, no-repeat, repeat-x, repeat-y Length
font-size Size of the font
background- Background image scrolls with element
font-family Specific font[s] to be used. %
attachment scroll, fixed em
background- (x y), top, center, bottom, left, right pt
Text position px
letter-spacing Space between letters Keywords
List
line-height Vertical space between baselines bolder
text-align Horizontal alignment list-style- Type of bullet or numbering in the list lighter
text- blink, line-through, none, type disc; circle; square; decimal; lower-roman; larger
decoration overline, underline upper-roman; lower-alpha; upper-alpha; none
Developing for
text-indent First line indentation list-style- Position of the bullet or number in a list IE6 is a lost cause.
position inside; outside
text- capitalise, lowercase, uppercase
transform list-style- Image to be used as the bullet in the list
image
vertical-align Vertical alignment
word-spacing Spacing between words