CSS/Properties/height
From Web Education Community Group
< CSS | Properties
Contents |
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>
CSS Reference
The CSS specification defines the height property in 10.5 Content height.

