Cheat Sheets – CSS

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
File loading please wait...
Citation preview

CSS CHEAT SHEET Shorthand* background border borderbottom border-left border-right border-top font list-style margin padding

Comments

SYNTAX Syntax selector {property: value;}

:hover :active :focus :link :visited :first-line :first-letter

Media Types all braille embossed handheld print projection screen speech tty tv

Units Length % em

height; width; margin-top; margin-right; margin-bottom; margin-left; padding-top; padding-right; paddingbottom; padding-left;

External Style Sheet

Internal Style

Inline Style

/* Comment */

Pseudo Selectors

BOX MODEL

GENERAL

BORDER border-width Width of the border border-style dashed; dotted; double; groove; inset; outset; ridge; solid; none

Class ID

String preceded by a period String preceded by a hash mark

div span color

Formats structure or block of text Inline formatting Foreground color

clear

Any floating elements around the element? both, left, right, none

cursor display

Appearance of the cursor

float

Floats to a specified side left, right, none

overflow

How content overflowing its box is handled visible, hidden, scroll, auto

left

The left position of an element auto, length values (pt, in, cm, px)

visibility

visible, hidden

top

The top position of an element auto, length values (pt, in, cm, px)

position

static, relative, absolute

z-index

Element above or below overlapping elements? auto, integer (higher numbers on top)

block; inline; list-item; none

FONT

border-color Color of the border

POSITION

font-style

Italic, normal

font-variant

normal, small-caps

font-weight

bold, normal, lighter, bolder, integer (100-900)

font-size

Size of the font

background-color

Background color

Specific font(s) to be used

background-image background-repeat

Background image

background-attachment

Background image scroll with the element? scroll, fixed

font-family

TEXT letter-spacing

Space between letters

line-height

Vertical distance between baselines

BACKGROUND

repeat, no-repeat, repeat-x, repeat-y

pt px Keywords bolder lighter larger

text-align text-decoration

Horizontal alignment

text-indent text-transform

First line indentation

vertical-align word-spacing

Vertical alignment Spacing between words

background-position

blink, line-through, none, overline, underline capitalize, lowercase, uppercase

(x y), top, center, bottom, left, right

LIST list-styletype

Type of bullet or numbering in the list disc; circle; square; decimal; lower-roman; upper-roman; loweralpha; upper-alpha; none

list-styleposition

Position of the bullet or number in a list inside; outside

list-styleimage

Image to be used as the bullet in a list

* The properties for each selector are in the order they should appear when using shorthand notation.