wood burning stoves
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 Building Microservices this week in the Design 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 :
rect.style.overflow="hidden" or rect.style.fontSize="1px"

For your function,i think you should choice 'rect.style.overflow="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.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: minimum div height in IE?
It's not a secret anymore!