网站在IE7中被破坏

时间:2011-09-16 15:46:26

标签: html css drupal-7

网站:http://bit.ly/nFJOWi

我一直在调试这个网站,并且已经在IE8,IE9,FireFox,Chrome和Safari中使用它,但主页特色框+主要NAV菜单在IE7中出现断开/不合适。什么想法或想法可能导致问题?

2 个答案:

答案 0 :(得分:2)

IE7可能是个问题,我能想到的最好的事情就是在你的页面上添加这样的内容:

<!--[if IE 7]>    
<link rel="stylesheet" type="text/css" href="css/ie7.css" />
<![endif]-->

然后覆盖您创建的适用于IE7.css样式表中其他浏览器的CSS规则,直到您在IE7中使用它为止。

答案 1 :(得分:0)

我喜欢解决IE问题的另一种方法是使用条件样式表 http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/

将此代码放在文档的头部

<!--[if lt IE 7 ]> <html class="ie6"> <![endif]-->
<!--[if IE 7 ]>    <html class="ie7"> <![endif]-->
<!--[if IE 8 ]>    <html class="ie8"> <![endif]-->
<!--[if IE 9 ]>    <html class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html class=""> <!--<![endif]-->

然后通过在通用样式表中编写特定规则来定位ie7(保存http请求) .ie7 div {zoom:1;}(示例)