text-height property CSS Reference



Definition and Usage

The 'text-height' property determine the block-progression dimension of the text content area of an inline box.

Name: text-height
Value: auto | font-size | text-size | max-size
Initial: auto
Applies to: inline elements and parents of element with display:ruby-text
Inherited: yes
Percentages: N/A
Media: visual
Computed value: specified value (except for initial and inherit)

Syntax

text-height: auto | font-size | text-size | max-size;

Values

auto
The block-progression dimension is based either on the em square determined by the element font-size property value or the cell-height (ascender + descender) related to the element font-size as chosen by the user agent.
font-size
The block-progression dimension is based on the em square as determined by the element font-size.
text-size
The block-progression dimension is based on the cell-height (ascender + descender) related to the element font-size.
max-size
The block-progression dimension is based on the maximum extents toward the before-edge and after-edge of the box obtained by considering all children elements located on the same line, ruby annotations (elements with 'display:ruby-text') and baseline shifted elements.

When more than one font-size is used (this could happen when glyphs are found in different fonts), it is recommended that the largest font-size provides the em square and the cell-height.

Although the 'text-height' property does not apply directly to block elements, it applies to their anonymous children inline elements (if any).


Examples

.class {
text-height: font-size;
} 

Relative articles