basics of website design banner photo

HTML

HTML 5

CSS 2.1

CSS 3

Reference

CSS line-height Property

The line-height property sets the line height of content - the line height being the distance between lines of text.

Possible Values

  1. normal - a normal line height - the default value.
  2. percentage - a percentage of the current font size.
  3. number - a number which is multiplied by the current font size to give the line height.
  4. A length value:
    • em - relative unit - the width of the 'font-size' of the font in use.
    • ex - relative unit - the height of the letter 'x' in the current font.
    • in - absolute unit - inches.
    • mm - absolute unit - miilimeters.
    • cm - absolute unit - centimeters.
    • pt - absolute unit - points - a point is 1/72nd of an inch.
    • pc - absolute unit - picas - one pica = 12 pt.
    • px - absolute unit - pixel - one pixel = 0.75 pt.
  5. inherit - the value is inherited from the parent element.

Examples:
p{line-height: 0.8}

The line-height in this paragraph has been set using a number value of 0.8.The line-height in this paragraph has been set using a number value of 0.8.The line-height in this paragraph has been set using a number value of 0.8.The line-height in this paragraph has been set using a number value of 0.8.

p{line-height: 3em}

The line-height in this paragraph has been set using a length value of 3em.The line-height in this paragraph has been set using a length value of 3em.The line-height in this paragraph has been set using a length value of 3em.The line-height in this paragraph has been set using a length value of 3em.

CSS 2.1 Property List