Problems With line-height - 1

This page tests the inline formatting model (inline boxes, line boxes, and so on) in the ways that it affects line-height.

See CSS2, section 10.8.1.

Prerequisites
Browsers that are subjected to this test should support CSS font-size, line-height, vertical align, inline styles and classes.

1. By Factor

The following paragraph contains various sizes of text. However, because the line-height is set numerically, there should be no overlap of text.

For each line, the line height should be the line-height of the biggest element on the line.

   .example       { font-size: 10px; }
   .one           { line-height: 1.3; }

Calculated line height here should be 13 pixels. 250%: Calculated line height here should be about 33 pixels. Calculated line height here should be 13 pixels. 350%: Calculated line height here should be about 46 pixels. Calculated line height here should be 13 pixels. 50%: Calculated line height here should be about 7 pixels. Calculated line height here should be 13 pixels. 200%: Calculated line height here should be about 26 pixels. Calculated line height here should be 13 pixels.

Once again: there should be no overlap in the text above.

2. By Percentage

The following paragraph contains two sizes of text. However, because the line-height is set by using percentages, the height of every line should be exactly the same, that is, 13px. Note that the large text has it's style specified inline, using the style attribute.

   .example       { font-size: 10px; }
   .two           { line-height: 130%; }
   /* Set by style attribute: */
   #big           { font-size: 300%; vertical-align: bottom; } 

Calculated line height here should be 13 pixels. Calculated line height here should be 13 pixels. Calculated line height here should be 13 pixels. Calculated line height here should be 13 pixels. Calculated line height here should be 13 pixels. Calculated line height here should be 13 pixels. Calculated line height here should be 13 pixels. Calculated line height here should be 13 pixels. Calculated line height here should be 13 pixels. Calculated line height here should be 13 pixels. Calculated line height here should be 13 pixels. Calculated line height here should be 13 pixels. Calculated line height here should be 13 pixels. (should not affect line height) Calculated line height here should be 13 pixels. Calculated line height here should be 13 pixels. Calculated line height here should be 13 pixels. Calculated line height here should be 13 pixels. Calculated line height here should be 13 pixels. Calculated line height here should be 13 pixels. Calculated line height here should be 13 pixels. Calculated line height here should be 13 pixels. Calculated line height here should be 13 pixels. Calculated line height here should be 13 pixels. Calculated line height here should be 13 pixels. Calculated line height here should be 13 pixels.

3. By Percentage (Bigger Version)

The following paragraph is the same as the previous test, but with a considerably bigger font-size as a base. This makes it easier to remove the possibility of rounding errors.

Line height here should be 50 pixels. Line height here should be 50 pixels. Line height here should be 50 pixels. Line height here should be 50 pixels. Line height here should be 50 pixels. Line height here should be 50 pixels. Line height here should be 50 pixels. Line height here should be 50 pixels. Line height here should be 50 pixels. (no effect) Line height here should be 50 pixels. Line height here should be 50 pixels. Line height here should be 50 pixels. Line height here should be 50 pixels. Line height here should be 50 pixels. Line height here should be 50 pixels. Line height here should be 50 pixels. Line height here should be 50 pixels.

Submit Results

How does your browser fare on this test?


Up to the Evil Tests Page.

Bugzilla: Bug 1990 (fixed), Bug 4233

Last updated in January 1999.