aspose file tools*
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
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "minimum div height in IE?" Watch "minimum div height in IE?" New topic
Author

minimum div height in IE?

Karen Nelson
Ranch Hand

Joined: Aug 19, 2005
Posts: 57
Hi,
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!!
Karen.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Play with:

line-height
font-size
overflow

Eric
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 agree. Here's the link: http://aspose.com/file-tools
 
subject: minimum div height in IE?