Forum Moderators: phranque

Message Too Old, No Replies

Making a "height: 1px;" div work in IE

Is there a hack or something?

         

zulufox

8:29 pm on Aug 6, 2004 (gmt 0)

10+ Year Member



Ive been trying for hours to make a 1px hieght div work in ie and its impossible...

Works perfect in mozilla... but NOOOO ie cant obey the rules...

GAAARRRGGHHHH

rmplmn

7:16 pm on Aug 7, 2004 (gmt 0)

10+ Year Member



Try setting 'line-height' to 1px. It works for me.

isitreal

3:26 pm on Aug 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



And font-size:1px

IE defaults to about a 14-6 pixel height on divs, you have to explicitly tell it to use a shorter height. You need the font-size set tiny too in case there is a space in the div, like <div> </div>, a space is a character, and if you have a character ie will assign it a height corresponding to the default font size of your page.

shorthand:

font: normal 1px/1px arial;