CSS Line Height

CSS line height property specifies the minimal height between the lines of the content. You can control the space below of the lines using this property.

There are some values of CSS line height property.

  • normal - It is the default value of line height property.
  • number - It defines a number that is multiplied by the current font size to calculate the line height.
  • length - It is used to set the line height using pt, px, cm etc.
  • % - The percentage value is used to set the line height using percent of the current font.
  • initial - It is used to set the line height with its default value.
  • inherit - It is used to inherit the line height from its parent value.

line-height Property Example

visible is the default value of overflow property.

Here is an example of static value:

Example:

p.pixel {
  line-height: 20px;
}

p.percentage {
  line-height: 70%;
}

p.number {
  line-height: 2;
}

Run Example