The CSS line-height Attribute

This attribute determines the height of HTML elements - with block elements this occurs because the heights of each individual line of text as well as hardcoded line breaks, <br> in the element are affected by this setting. Use the code line-height:value where value is either normal, a CSS length unit or a raw number. In the last case the number is a scaling factor for the inherited value. The default value is normal.

Line heights cannot be negative. Although there would normally be no good reason to do so, it is possible get lines to overlap one another by adjusting the line-height setting. With an adequate line-height setting the difference between line-height and font-size is shared equally above and below the text. This is known as leading in CSS - as is so often the case, this is terminology borrowed from traditional typesetting.

This is an inherited property - i.e. in a child element, if not assigned, it takes the corresponding value from the containing parent.

Jump To...

Colophon