HTML Reference

HTML Reference

CSS Selectors

Selectors

* {}

selects all elements

p {}

selects all <p> elements

*.c {}

selects all elements where

p.c {}

selects all <p> elements where

#main {}

selects one element where id =”main”

a:link {}

Learn more

Layout CSS properties and values

Layout

Inherited

Default value

Possible values

Float

 

Applies to all except cells and rows

float:

 

none

left, right

Clear

 

Applies to all except inlines, inline-blocks, cells, & rows.

clear:

Learn more

Content CSS properties and values

Content

Inherited

Applies to all except for rows

default value

possible values

padding:

0
LENGTH

padding-left:

0
LENGTH

padding-right:

0
LENGTH

padding-top:

0
LENGTH

padding-bottom:

0
LENGTH

font:
yes
caption
Icon, menu, message-box, small-caption, status-bar

font-family:
yes
serif
FONTLIST, sans-serif, monospace, fantasy, cursive

font-size:
yes
medium
LENGTH,%ParentElementFontSize, xx-small,x-small, smaller, small, large, larger, x-large,  xx-large

font-style:
yes
normal
italic, oblique

font-variant:
yes
normal
small-caps

font-weight:
yes
normal
Lighter, bold, bolder, 100, 200, 300, 400, 500, 600, 700, 800, 900

text-decoration:
yes
none
underline, line-through, …

Learn more

Common CSS properties and values

The next list includes only those CSS properties and values that work in all the major browsers.

Commom

Inherited

Applies to all elements and box models

default value

possible values

display:

inline
none, block, inline-block, list-itme, table-cell, table, table-row

visibility:
yes
visible
hidden

background-color:

transparent
COLOR

background-image:

none
url(“file.jpg”)

background-attachment:

scroll
fixed

background-position:

0% 0%
H% V%, H V, left top, left center, left …

Learn more

Typical font-size values at 96 dpi

CSS

Ems

Points

Pixels

Percent

Heading

HTML

Physical Size

xx-small

0.50em

0.57em

6pt

7pt

8px

9px

50%

57%

 

 

10pixels

12pixels

x-small

0.63em

0.69em

0.75em

7.5pt

8pt

9pt

10px

11px

12px

63%

69%

75%

h6

1

 

2

12pixels

13pixels

14pixels

small

0.82em

0.88em

0.94em

9.75pt

10.5pt

11.25pt

13px

14px

15px

82%

88%

94%

h5

 

16pixels

Learn more

Ratios between units of measure at 96 dpi

Value
Pixel
Point
Pica
Inch
Millimeter

1 pixel
=1 px
=0.75pt(3/4)
=0.063pc(1/16)
=0.0104in(1/96)
=0.265mm

1 point
=1.333px(4/3)
=1pt
=0.083pc(1/12)
=0.0138in(1/72)
=0.353mm

1 pica
=16px
=12pt
=1pc
=0.1667in(1/6)
=4.233mm

1 …

Learn more