Professional Documents
Culture Documents
CSS CHEAT SHEET
Shorthand* SYNTAX BOX MODEL
background Syntax height; width; margintop;
border selector {property: value;} marginright; margin
borderbottom bottom; marginleft;
borderleft External Style Sheet paddingtop; paddingright;
borderright <link rel="stylesheet" type="text/css" paddingbottom; padding
bordertop href="style.css" /> left;
font Internal Style
liststyle
margin <style type="text/css">
padding selector {property: value;}
</style>
Comments Inline Style
/* Comment */ <tag style="property: value"> BORDER
border Width of the border
Pseudo GENERAL width
Selectors Class String preceded by a period border dashed; dotted; double; groove; inset; outset;
:hover style ridge; solid; none
ID String preceded by a hash mark
:active border Color of the border
:focus div Formats structure or block of text
color
:link span Inline formatting
:visited color Foreground color
:firstline POSITION
:firstletter cursor Appearance of the cursor clear Any floating elements around the element?
display block; inline; listitem; none both, left, right, none
Media overflow How content overflowing its box is float Floats to a specified side
Types handled left, right, none
all visible, hidden, scroll, auto
braille left The left position of an element
embossed visibility visible, hidden auto, length values (pt, in, cm, px)
handheld top The top position of an element
print FONT auto, length values (pt, in, cm, px)
projection
screen fontstyle Italic, normal position static, relative, absolute
speech font
tty normal, smallcaps zindex Element above or below overlapping elements?
variant
tv auto, integer (higher numbers on top)
font bold, normal, lighter, bolder, integer
weight (100900)
Units BACKGROUND
Length % fontsize Size of the font
backgroundcolor Background color
em font Specific font(s) to be used
pt backgroundimage Background image
family
px backgroundrepeat repeat, norepeat, repeatx, repeaty
Keywords TEXT
bolder background Background image scroll with the
lighter letter Space between letters attachment element?
larger spacing scroll, fixed
lineheight Vertical distance between background (x y), top, center, bottom, left, right
baselines position
textalign Horizontal alignment
text blink, linethrough, none, overline, LIST
decoration underline liststyle Type of bullet or numbering in the list
textindent First line indentation type disc; circle; square; decimal; lowerroman; upper
roman; loweralpha; upperalpha; none
text capitalize, lowercase, uppercase
transform liststyle Position of the bullet or number in a list
vertical Vertical alignment position inside; outside
align liststyle Image to be used as the bullet in a list
word Spacing between words image
spacing
* The properties for each selector are in the order they should appear when using shorthand notation.
http://lesliefranke.com/files/reference/csscheatsheet.html 1/1