CSS/Properties/height

From W3C Wiki
< CSS‎ | Properties
Revision as of 18:08, 16 June 2011 by Hiroki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

height

The height property specifies the content height of boxes.

Description

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


Values

  • <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

Example A

[style.css]

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

[index.html]

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


Csslist2 height.png

CSS Reference

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