Click to See Complete Forum and Search --> : height in IE????


DJRobThaMan
01-29-2006, 06:10 PM
Hi,

I have the following code that I'm trying to get to work in all browsers


<div style="clear:both; background-color:brown; height:2px;">
</div>


In Mozilla/Netscape it's perfect. A horizontal bar of brown 2 pixels high. But in IE the bar is something like 20 pixels high and the height attribute doesn't start affecting the height of the div until I feed it a value greater than that.

Does anybody know how I can fix this?

Thanks,
Douglas

thewebman
01-29-2006, 08:55 PM
try to add font-size: 1px; to the style.

DJRobThaMan
01-29-2006, 10:32 PM
It worked... Thanks a bunch

terrawolf
01-31-2006, 12:04 AM
You can use overflow:hidden; instead of setting the font height also.