6.2 Line Height Calculations in Almost Standards Mode

Inline elements contribute to line height if and only if one of the following is true.

If the element:

  • Contains text characters

  • Has a nonzero border width

  • Has a nonzero margin

  • Has a nonzero padding

  • Has a background image

  • Has vertical-align set to a value other than baseline

Note that a line break is not considered a text character for this definition unless it is the only content of a line box. In that case, the line box height remains the uppermost inline box top and the lowermost inline box bottom on the line, regardless of the specified line height.

If an img element is the sole content of a table cell, the line box height of the cell line box height is adjusted to zero.

Show: