How to set div height in IE6 a to small value such as 5px?
IE6 doesn’t render correctly the height of a small value. It just doesn’t shrink to a such small value. The answer is to use overflow : hidden
. The overflow
property sets what happens if the content of an element overflow its area.
Possible values:
visible - Default. The content is not clipped. It renders outside the element
hidden - The content is clipped, but the browser does not display a scroll bar to see the rest of the content
scroll - The content is clipped, but the browser displays a scroll bar to see the rest of the content
auto - If the content is clipped, the browser should display a scroll bar to see the rest of the content
Javascript syntax:
object.style.overflow="hidden";
It seems that IE6 has some kind of default value for div, which doesn’t fit in the height of 5px.