CSS text-height Property

Description

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

The text-height property has been deprecated or is no longer in any CSS working groups.

Initial value
auto
Applies to
inline elements and parents of element with display:ruby-text
Inherited
Yes
Media
Visual
Computed value
As specified, except for initial and inherit
Animatable
No
CSS Version
CSS3
JavaScript syntax
object.style.textHeight

Syntax

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

Values

  • autoThe 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-sizeThe block-progression dimension is based on the em square as determined by the element font-size.
  • text-sizeThe block-progression dimension is based on the cell-height (ascender + descender) related to the element font-size.
  • max-sizeThe 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.

Example

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

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
??????
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
??????