CSS Cheat Sheet

Quick and Fast Learn CSS Cheat Sheet References.

Fonts

font-family
font-style
font-variant
font-weight
font-stretch
font-size
font-size-adjust

Text

text-align
text-indent
text-decoration
text-shadow
word-spacing
letter-spacing
text-transform
white-space

Table

table-layout
border-collapse
border-spacing
caption-side
empty-cells
speak-header

Outline

outline
outline-width
outline-style
outline-color

Selectors

*
div
div *
.class
All Elements
<div>
Element within <div>
Elements of class
div.class
#numid
div#numid
a[class]
a[class="x"]
<div> of class
Elements with ID "numid"
div with ID "numid"
<a> with class attribute
<a> when class is "x"

Measurement Units

px - pixels
em - 1em to font size parent (same as 100%)
ex - Height of lowercase "a"
% - Percentage
cm - Centimeters
mm - Millimeters

CSS Syntax

/* CSS Comments */
Selectors {
     property: value;
}

@media type {
}

Layout Model

margin*
margin-top
margin-bottom
margin-left
margin-right
padding*
padding-top
padding-bottom
padding-left
padding-right
border*
border-top
border-bottom
border-left
border-right
border-style*
border-top-style
border-bottom-style
border-left-style
border-right

Positioning

display
position
top
bottom
left
right
float
clear
z-index
direction
overflow
visibility

Dimensional

width
max-width
min-width
height
max-height
min-height

List

list-style*
list-style-type
list-style-image
list-style-position

Pseudo Class

:link
:active
:hover
:visited
:lang
:first-child
:first-line
:first-letter

Media Type

all
braille
embossed
handheld
print
projection
screen
speech
try
tv