Jonah
Jonah

Reputation: 16232

ie7: absolute div in centered relative parent behaving strangely

The issue is best explained with pictures, but you can try it for yourself here:

http://pastehtml.com/view/b3y7e9uz6.html

Simply compare ie7 to (ie8 or ff or chrome). It looks like this in modern browsers:

Modern Browsers

and like this in ie7:

ie7

What is causing it to be offcenter in ie7?

Upvotes: 2

Views: 319

Answers (1)

Akkuma
Akkuma

Reputation: 2265

As soon as you remove the position: absolute everything corrects itself, minus the red border; however, that is extremely easy to solve by applying the appropriate borders to the sides you want them on.

If you must keep the position: absolute add left: 0 and that appears to correct it as well. IE7 probably requires a left/right or gets slightly messed up as it doesn't know where to position it.

Upvotes: 4

Related Questions