From W3C Wiki
Jump to: navigation, search


The height property specifies the content height of boxes.


Values <length> | <percentage> | auto | inherit
Initial value auto
Applies to All elements but non-replaced inline elements, table columns, and column groups
Inherited No


  • <length>
    Specifies the height of the content area using a length value.

  • <percentage>
    Specifies a percentage height. The percentage is calculated with respect to the height of the generated box's containing block.

  • auto
    The height depends on the values of other properties.

  • inherit
    Takes the same specified value as the property for the element's parent.


Example A


 p {
   width: 400px;
   height: 200px;
   background-color: #999;


  <p>This is a paragraph.</p>

Csslist2 height.png

CSS Reference

The CSS specification defines the height property in 10.5 Content height.