...

View Full Version : Top margin IE7 error



boogily
02-13-2011, 08:57 PM
I am working on a site, and an absolute positioned element seems to behave weird only in IE7. There is a ribbon that is in the upper right hand corner that says "resource center" with a plus sign by it.

In all other browsers it is positioned lower, so it covers up most of the top header, which is the way it is supposed to be. How can I fix it so that it's vertical position isn't so high?

http://rocket55clients.com/koch/index.php?option=com_content&view=article&id=1&Itemid=2

Excavator
02-13-2011, 09:02 PM
Hello boogily,
Some versions of IE don't seem to do negative margins very well. Since that graphic's container is absolutely positioned, why not use top: -26px; in place of the negative margin?

boogily
02-14-2011, 02:46 AM
Switched to negative top, still does it

Excavator
02-14-2011, 02:54 AM
IE is so odd about this kind of thing. Could be you need to specify height/width of that element? Height at least -
<div style="position: absolute; right: 20px; top: -26px; height: 60px;">

Why the inline styles? Also, it's just an anchor with an image so it hardly needs to be in it's own div. It doesn't make sense to be nested in paragraph tags either...

Excavator
02-14-2011, 03:00 AM
One more thing, your unnamed inline styled <div style="width:1001px; margin:0 auto; position:relative;"> only encloses the graphic your trying to put negative position on?

That graphic should be position off a relative container of the whole site, or the #header... probably not some random div sitting at the top of the site doing nothing.

boogily
02-14-2011, 03:25 AM
Thanks. I so overthought this. I just made it relative to the header. Thats it. Thanks@!

Excavator
02-14-2011, 04:01 AM
Thanks. I so overthought this. I just made it relative to the header. Thats it. Thanks@!

Right on, glad you got it going :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum