Set the height of an element.
Syntax height: height | inherit ;
height - the height in px, pt or em.
inherit - inherit from the parent element.
If a div contains more text than will fit within a limited height, then it will scroll below the bottom border.
Examples:
h1 { height: 25px; }
.emw3class { height: 2em; }
#emw3id { height: 25pt; }
Try it:
This is a sample of text with a CSS border. The border helps to display the height of the DIV. |
(CSS 1) Browser Support: All major browsers. IE versions up to and including 7 don’t support the value inherit.
“Happiness makes up in height what it lacks in length” ~ Robert Frost
Related:
max-height - Maximum height of an element.
min-height - Minimum height of an element.
width - Width of an element.