Click to See Complete Forum and Search --> : IE7 bug with margins and/or padding?


zenthoef
12-04-2008, 10:31 PM
I found an apparent bug in IE 7 that is apparently displaying a bottom margin incorrectly for my webpage.

I am using div's and css to format everything. The bug is that IE7 is inserting 5 extra pixels on the bottom margin of an image. The image is actually an image rollover that uses javascript to function.

Is the best way to deal with this to put some code in to say "if the browser is IE7 then do a margin with -5 pixels"? Or is there a better way to do this? Using a margin of -5px gets rid of the extra margin, but destorys my border...

Thanks in advance.

infinityspiral
12-05-2008, 02:09 PM
I've found these types of errors are usually caused by unclosed floats. Also you could try setting the overflow:none;

zenthoef
12-05-2008, 05:53 PM
I'm going to have to admit my ignorance here... but that's how we learn! What do you mean by an unclosed "float"?

infinityspiral
12-05-2008, 10:41 PM
Ah these would be either float:left or float:right applied to the elements using CSS. Normally you'd want to have an element follow these floated elements with the clear:both; CSS setting applied to it. If you're not using the float command though I'd bet it's a padding/margin issue. This might be able to be fixed by setting a height on the element and setting overflow to none. Hope this helps!

zenthoef
12-06-2008, 10:35 AM
It was a stupid height/margin issue! Thanks!