NOTICE: This website is no longer updated or supported - as such many of the techniques used to build it may seem antiquated in the modern day. It is preserved for historical reasons only.

HTML XHTML The Complete Reference
home » reference » appendix b » css1 / css2 properties

height


This property sets the height of an element's content region (excluding padding, border, and margin). It is generally used on positioned block elements. Absolute measurements as well as percentage values are allowed. Percentage values are based on the height of the containing element. The default value auto automatically calculates the height of an element, based on the height of the containing element and the size of the content. Negative values are not allowed.

Examples



p {height: 200px; padding: 10px; border: solid 5px;}
#div1 {height: 50%; width: 50%;}

Browser and CSS Support Notes


CSS1
IE 4, 5, 5.5, 6
Nav 4, 4.5-4.8, 6, 7
Opera 4, 5, 6, 7

(X)HTML Elements
CSS Properties
Back: font Next: left
< Home | About | Chapters | Examples | Errata | Reference | Site Map >