开发者

vertical alignment issue compatibility mode IE

开发者 https://www.devze.com 2023-02-11 20:08 出处:网络
I\'m having a strange problem while building up the structure for a web site. Basically I have: .container(height:30px;line-height:30px;)

I'm having a strange problem while building up the structure for a web site. Basically I have:

.container(height:30px;line-height:30px;)

in which I have few links (font-size:14px) that I want vertical-aligned开发者_运维百科 to the middle of my div.everything is fine,i switched the compatibility views button on IE and everything is still ok. the problem is if i change the font size to 12px and i switch the compatibility view my links are not vertical-aligned anymore!

Im testing on IE8

why is this happening? what-s the solution?

thanks luca


You might have found the solution but in case you don't,

I had the same problem with vertical-align in IE8. The easiest way I found to stop spending so much time is by adding this well known code in the Head.

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

This code brings back IE8 to IE7 engine which support vertical-align in a better way.

If you got something better than that , I'm open to learn something new :)

Cheers!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号