ie7: absolute div in centered relative parent behaving strangely
The is开发者_如何学Gosue 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:
and like this in ie7:
What is causing it to be offcenter in ie7?
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.
精彩评论