How to set div height in IE6 to small value such as 5px?

IE6 doesn't render correctly height of small value. It just doesn't shrink to 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 height of 5px.


Posted on Wednesday, June 25, 2008 by | Comments (1) | Add Comment

Comments

Gravatar

Re:How to set div height in IE6 to small value such as 5px?

You could add the font-size:1px to your css, targeting the div with the 5px height. Then IE6 will render the height as IE7, FF does.

Posted on 11/18/2008 12:55:41 AM by Esben #
Gravatar

I didn't know that. Thank you for a tip.

New Comment

Your Name:
Email (for internal use only):
Comment:
 
Code above:

Categories

Recent Tweets

  • Simon Ince's Blog: Hierarchies with HierarchyID in SQL 2008 http://t.co/xSDwiF6rRS.
  • Visual Studio 2010 WAS painfully slow - CodeProject http://t.co/Usba1x6CZy

Valid HTML5