O'Reilly logo

CSS Pocket Reference, 4th Edition by Eric A. Meyer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

height

Values:

<length> | <percentage> | auto

Initial value:

auto

Applies to:

All elements except nonreplaced inline elements, table columns, and column groups

Inherited:

No

Percentages:

Calculated with respect to the height of the containing block

Computed value:

For auto and percentage values, as declared; otherwise, an absolute length, unless the property does not apply to the element (then auto)

Description:

Defines the height of either an element’s content area or its border box, depending on the value of box-sizing. Negative length and percentage values are not permitted.

Examples:

img.icon {height: 50px;}
h1 {height: 1.75em;}

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required