Cascading Style Sheets (CSS)

Reference & Browser Support

Background Attributes

background

Valuesbackground-color || background-image || background-repeat || background-attachment || background-position
Initial Valuerefer to individual properties below
Inheritedno
Applies toall elements
DOM Reference[window.]document.getElementById("elementID").style.background
SpecificationW3C

background-attachment

Valuesfixed | scroll
Initial Valuescroll
Inheritedno
Applies toall elements
DOM Reference[window.]document.getElementById("elementID").style.backgroundAttachment
SpecificationW3C

background-color

Valuescolour | transparent
Initial Valuetransparent
Inheritedno
Applies toall elements
DOM Reference[window.]document.getElementById("elementID").style.backgroundColor
SpecificationW3C

background-image

Valuesuri | none
Initial Valuenone
Inheritedno
Applies toall elements
DOM Reference[window.]document.getElementById("elementID").style.backgroundImage
SpecificationW3C

background-position

Values[percentage | length] {1,2} | [top | center | bottom] || [left | center | right]
Initial Value0% 0%
Inheritedno
Applies toblock-level and replaced elements
DOM Reference[window.]document.getElementById("elementID").style.backgroundPosition
SpecificationW3C

background-position-x,
background-postion-y

Values[percentage | length] | [left | center | right]
[percentage | length] | [top | center | bottom]
Initial Value0%
Inheritedno
Applies toblock-level and replaced elements
DOM Reference[window.]document.getElementById("elementID").style.backgroundPositionX
[window.]document.getElementById("elementID").style.backgroundPositionY
SpecificationMicrosoft

background-repeat

Valuesno-repeat | repeat | repeat-x | repeat-y
Initial Valuerepeat
Inheritedno
Applies toall elements
DOM Reference[window.]document.getElementById("elementID").style.backgroundRepeat
SpecificationW3C

Font Attributes

font

Valuesfont-style || font-variant || font-weight || font-size[/line-height] || (font-family | caption | icon | menu | message-box | small-caption | status-bar)
Initial Valuerefer to individual properties below
Inheritedyes
Applies toall elements
DOM Reference[window.]document.getElementById("elementID").style.font
SpecificationW3C

font-family

Values[fontName [, fontName [, … ]] [, fontFamily]] | fontFamily
Initial Valuebrowser specific
Inheritedyes
Applies toall elements
DOM Reference[window.]document.getElementById("elementID").style.fontFamily
SpecificationW3C

font-size

Valuesxx-small | x-small | small | medium | large | x-large | xx-large | smaller | larger | length | percentage
Initial Valuemedium or font-size of parent element
Inheritedyes
Applies toall elements
DOM Reference[window.]document.getElementById("elementID").style.fontSize
SpecificationW3C

font-size-adjust

Valuesz-factor | none
Initial Valuenone
Inheritedyes
Applies toall elements
DOM Reference[window.]document.getElementById("elementID").style.fontSizeAdjust
SpecificationW3C

font-stretch

Valuesultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | extra-expanded | ultra-expanded | narrower | wider | normal
Initial Valuenormal
Inheritedyes
Applies toall elements
DOM Reference[window.]document.getElementById("elementID").style.fontStretch
SpecificationW3C

font-style

Valuesnormal | italic | oblique
Initial Valuenormal
Inheritedyes
Applies toall elements
DOM Reference[window.]document.getElementById("elementID").style.fontStyle
SpecificationW3C

font-variant

Valuesnormal | small-caps
Initial Valuenormal
Inheritedyes
Applies toall elements
DOM Reference[window.]document.getElementById("elementID").style.fontVariant
SpecificationW3C

font-weight

Valueslighter | normal | bold | bolder | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
Initial Valuenormal
Inheritedyes
Applies toall elements
DOM Reference[window.]document.getElementById("elementID").style.fontWeight
SpecificationW3C

Text Attributes

color

Valuescolour
Initial Valuebrowser specific
Inheritedyes
Applies toall elements
DOM Reference[window.]document.getElementById("elementID").style.color
SpecificationW3C

direction

Valuesltr | rtl
Initial Valueltr
Inheritedyes
Applies toall elements
DOM Reference
SpecificationW3C

letter-spacing

Valueslength | normal
Initial Valuenormal
Inheritedyes
Applies toall elements
DOM Reference[window.]document.getElementById("elementID").style.letterSpacing
SpecificationW3C

line-height

Valueslength | percentage | number | normal
Initial Valuenormal
Inheritedyes
Applies toall elements
DOM Reference[window.]document.getElementById("elementID").style.lineHeight
SpecificationW3C

text-align

Valuesleft | center | right | justify
Initial Valuebrowser specific
Inheritedyes
Applies toblock-level elements
DOM Reference[window.]document.getElementById("elementID").style.textAlign
SpecificationW3C

text-align-last

Valuesauto | left | center | right | justify
Initial Valueauto
Inheritedyes
Applies toblock-level elements
DOM Reference[window.]document.getElementById("elementID").style.textAlignLast
SpecificationMicrosoft

text-decoration

Valuesnone | (underline || overline || line-through || blink)
Initial Valuenone
Inheritedno
Applies toall elements
DOM Reference[window.]document.getElementById("elementID").style.textDecoration
SpecificationW3C

text-indent

Valueslength | percentage
Initial Value0
Inheritedyes
Applies toblock-level elements
DOM Reference[window.]document.getElementById("elementID").style.textIndent
SpecificationW3C

text-overflow

Valuesclip | ellipsis
Initial Valueclip
Inheritedyes
Applies toblock-level elements
DOM Reference[window.]document.getElementById("elementID").style.textOverflow
SpecificationMicrosoft

text-shadow

Values[color] horizLength vertLength blurRadiusLength [, [color] horizLength vertLength blurRadiusLength [, … ]] | none
Initial Valuenone
Inheritedno
Applies toall elements
DOM Reference
SpecificationW3C (removed as of CSS2.1)

text-transform

Valuesuppercase | lowercase | capitalize | none
Initial Valuenone
Inheritedyes
Applies toall elements
DOM Reference[window.]document.getElementById("elementID").style.textTransform
SpecificationW3C

vertical-align

Valuesbaseline | sub | super | bottom | text-bottom | middle | top | text-top | percentage
Initial Valuebaseline
Inheritedno
Applies toinline elements
DOM Reference[window.]document.getElementById("elementID").style.verticalAlign
SpecificationW3C

white-space

Valuesnormal | nowrap | pre | pre-wrap | pre-line | inherit
Initial Valuenormal
Inheritedyes
Applies toall elements
DOM Reference[window.]document.getElementById("elementID").style.whiteSpace
SpecificationW3C

word-spacing

Valueslength | normal
Initial Valuenormal
Inheritedyes
Applies toall elements
DOM Reference[window.]document.getElementById("elementID").style.wordSpacing
SpecificationW3C

word-wrap

Valuesbreak-word | normal
Initial Valuenormal
Inheritedyes
Applies toblock-level, sized inline and positioned elements
DOM Reference[window.]document.getElementById("elementID").style.wordWrap
SpecificationMicrosoft