I am working on a design at the moment in which I use empty divs to contain design elements through the use of css background images. It's not the best solution code wise, but it works and if used sparingly, it won't have any massive negative implications.
However I was scratching my head when I had some empty divs with a height of 6 pixels specified. Fine in Firefox, fine in Opera, NOT fine in ie. The heights were way more than 6 pixels.
Luckily I found the solution to the empty div ie problem in two seconds using Google!
The solutions given were as follows (I used method 2):
1) Put a comment inside the div:
2) Put inside the div and add this to its style: font-size:1px;
line-height:0.
go there
info
view

6 Comments:
thank you for this...
I hate IE
STuFF
yes, thank you!
:)
I just came across this problem, thanks for offering the solution - the first didn't work for me but the second did.
Please don't hate IE.
Every browser has its short and/long comings.
thanks!
Post a comment
<< Home