Visit Mozilla.org

CSS:height

From MDC

« CSS Reference

[edit] Summary

The height property specifies the height of the content area of an element. The content area is inside the padding, border, and margin of the element.

[edit] Syntax

height: <length> | <percentage> | auto | inherit

[edit] Values

  • length : can be in px, cm, in
  • percentage : % specified as a percentage of containing block's height
  • auto : the browser will calculate and select a height for the specified element

[edit] Examples

View Live Examples

table { height: 100%; }

img { height: 200px; }

form { height: auto; }

[edit] Notes

The min-height and max-height properties override height.

[edit] Specifications

[edit] Browser compatibility

Browser Lowest Version
Internet Explorer 4
Netscape 4
Opera 3.5

[edit] See also

box model, width, -moz-box-sizing, min-height, max-height