View Full Version : IE7 RC1 css margins applied to unintended elements....grrr
Leeoniya
09-09-2006, 02:27 PM
when i use css to add a left margin to an div, IE7 for some reason decides to apply that margin to neighboring div...WTF.
here's the site i'm working on....on my temp server.
http://24.13.207.101/GTR/
in ff and opera, everything looks dandy, i apply a "margin-left:9em" to the content div, and behold....the navmenu moves over as well in ie7....i dont get it, please someone explain this to me.
thanks,
Leon
_Aerospace_Eng_
09-09-2006, 03:14 PM
Get rid of position:absolute; on #navcont and add float:left; instead. Also add clear:both; to the #footer CSS.
Leeoniya
09-09-2006, 07:15 PM
thanks, it does work, still confused why it was happening in ie7 but not in ff or opera, was it not working cause ie7 is broken? or because it's the wrong way to do it and this is a workaround? if so, is MS aware of this prob, and what's the "name" assigned to this bug? sorry to be annoying.
thanks,
Leon
_Aerospace_Eng_
09-09-2006, 09:49 PM
It seems to happen on absolutely positioned elements that don't have a left property assigned to them. If you used position:absolute; with left:0; then it probably would work fine however most layouts require little or NO absolute positioning. Yours didn't. One thing you need to do now is add display:inline; to #navcont because of the left margin you are applying to it. This is doubled in IE6 when you don't have display:inline;. Making it display:inline seems to not effect any other browser because according to the specs an element that is floated by default becomes a block level element.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.