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

  • Initial valueauto
  • Applies toinline elements and parents of element with display:ruby-text
  • InheritedYes
  • MediaVisual
  • Computed valueAs specified, except for initial and inherit
  • AnimatableNo
  • CSS VersionCSS3
  • JavaScript syntaxobject.style.textHeight
Formal syntax: auto | font-size | text-size | max-size

text-height: auto;
text-height: font-size;
text-height: text-size;
text-height: max-size;
  • 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.
.class {
   text-height: font-size; 
}
?Firefox?Explorer?Chrome?Safari?Opera


Last updated on 23rd March 2014 By Rene Spronk

View All CSS Properties

Errors? Please help to keep this list up to date, If you find any errors, please contact us, so that we can get them fixed.