File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes minimum div height in IE? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "minimum div height in IE?" Watch "minimum div height in IE?" New topic

minimum div height in IE?

Karen Nelson
Ranch Hand

Joined: Aug 19, 2005
Posts: 57
I am trying to write some javascript code to do simple graphics, using DOM scripting to add div's with background colors. The following code works perfectly in Netscape to produce a line which is one pixel high and 90 pixels long: (obviously replacing onloadd with onload)

but in IE it produces a rectangle that's about 10 pixels high -- about the height of a line of text, in fact.

So my question is, is there a way around this? Or some other way to draw a line in IE?

Thank you!!
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
Play with:


Liu Zhixiang
Ranch Hand

Joined: Aug 12, 2006
Posts: 32
default in IE: FONT-SIZE control the hdight of div tag.
so you should add :"hidden" or"1px"

For your function,i think you should choice '"hidden"'
[ August 16, 2006: Message edited by: Liu Zhixiang ]

I Think Therefore I Am
Karen Nelson
Ranch Hand

Joined: Aug 19, 2005
Posts: 57
Thank you!!! Setting the overflow to hidden does work.
subject: minimum div height in IE?
It's not a secret anymore!