Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

minimum div height in IE?

 
Karen Nelson
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Play with:

line-height
font-size
overflow

Eric
 
Liu Zhixiang
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Karen Nelson
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you!!! Setting the overflow to hidden does work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic