Export (0) Print
Expand All
Expand Minimize

2.1.53 [CSS-Level2-2009] Section 10.8.1, Leading and half-leading

V0092:

The specification states:

CSS assumes that every font has font metrics that specify a characteristic height
 above the baseline and a depth below it. In this section we use A to mean that
 height (for a given font at a given size) and D the depth. We also define AD = A +
 D, the distance from the top to the bottom. (See the note below for how to find A
 and D for TrueType and OpenType fonts.) Note that these are metrics of the font as
 a whole and need not correspond to the ascender and descender of any individual
 glyph.
 
User agent must align the glyphs in a non-replaced inline box to each other by
 their relevant baselines, and to nested inline boxes according to 'vertical-
align'. Then, for each glyph, determine the A and D. Note that glyphs in a single
 element may come from different fonts and thus need not all have the same A and D.
 If the inline box contains no glyphs at all, it is considered to contain a strut
 (an invisible glyph of zero width) with the A and D of the element's first
 available font.

Quirks Mode and IE7 Mode (All Versions)

When the value of line-height is less than the content height, the portion of the font that would pass below the bottom edge of the content box is clipped and does not bleed outside of the box.

IE7 Mode (All Versions)

If a width, max-width, or min-width property is assigned to the inline box, the portion of the font that would pass above the top edge of the content box is clipped and does not bleed outside the box.

V0093:

The specification states:

‘line-height'

Value:                 normal | <number> | <length> | <percentage> | inherit
Initial:               normal
Applies to:            all elements
Inherited:             yes
Percentages:           refer to the font size of the element itself
Media:                 visual
Computed value:        for <length> and <percentage> the absolute value; otherwise as specified

Quirks Mode and IE7 Mode (All Versions)

The inherit value of the line-height property is not supported.

V0094:

The specification states:

On a block container element whose content is composed of inline-level elements,
 'line-height' specifies the minimal height of line boxes within the element. The
 minimum height consists of a minimum height above the baseline and a minimum depth
 below it, exactly as if each line box starts with a zero-width inline box with the
 element's font and line height properties. We call that imaginary box a "strut."
 (The name is inspired by TeX.) 

IE8 Mode and IE9 Mode (All Versions)

In almost standards mode, line-height does not define a minimal line height for inline content in block-level, table-cell, table-caption, or inline-block elements.

V0095:

The specification states:

On an inline-level element, 'line-height' specifies the height that is used in the 
calculation of the line box height (except for inline replaced elements, where the 
height of the box is given by the 'height' property).

IE8 Mode and IE9 Mode (All Versions)

In almost standards mode, the specified line-height has no effect on line box height calculation.

V0096:

The specification states:

The following values only have meaning with respect to a parent inline element, or to the strut of a parent block container element. 

Quirks Mode and IE7 Mode (All Versions)

If a box (e.g. empty inline-block or <img/> element) does not have a baseline, the element’s bottom margin edge is aligned with the parent’s bottom edge instead of with the parent’s baseline.

V0097:

The specification states:

Middle

Align the vertical midpoint of the box with the baseline of the parent box plus 
half the x-height of the parent.

Quirks Mode and IE7 Mode (All Versions)

The font ex height is not correctly calculated. It is assigned a value of 0.5em.

Show:
© 2015 Microsoft