简体   繁体   English

IE7的CSS问题

[英]CSS trouble with IE7

I am designing a website and it looks good in basically all browsers except IE7, where I have a problem I haven't been able to correct. 我正在设计一个网站,并且它在除IE7之外的所有其他浏览器中看起来都不错,因为我有一个我无法纠正的问题。 I have a menu in HTML like this: 我有这样的HTML菜单:

<div id="nav">
        <ul>
            <li id="cMenu"><a id="cart" href="#">Home</a></li>
            <li id="pMenu"><a id="promos" href="#">Promos</a></li>
            <li id="aMenu"><a id="anun" href="#">Ads</a></li>
        </ul>
    </div><!-- /nav -->

Then I have my CSS: 然后我有我的CSS:

div#nav{width:339px;height:120px;display:block;}

div#nav ul{list-style:none;}
div#nav ul li{display:inline;padding:20px;}
div#nav ul li a{width:30px;height:80px;}

div#nav ul li#cMenu{text-indent:-999999px;}
div#nav ul li a#cart{background:url(../img/menu2.png) 0 50px no-repeat;width:110px;height:120px;display:block;}
div#nav ul li a#cart:hover{background:url(../img/menu2.png) 0 -69px no-repeat;}

The thing here is that when I preview this on IE7 nothing gets displayed, I've tired positioning absolutely and also checking if everything is there by using border="dotted" and I get to see the border of only the div#nav, nothing else shows up. 这里的问题是,当我在IE7上预览此内容时,什么都没有显示,我已经完全厌倦了定位,还通过使用border =“ dotted”检查是否所有内容都存在,而我只能看到div#nav的边框,什么也没有其他出现。 (I didn't placed all of the css of the menu since it's basically the same just different id's). (我没有放置菜单的所有CSS,因为它基本上是相同的,只是ID不同)。

Does anybody knows what's wrong? 有人知道怎么了吗?

div#nav ul li#cMenu{text-indent:-999999px;} div#nav ul li#cMenu {text-indent:-999999px;}

by this its sending all inside li tag to -9999999 text-indent 通过此将其所有内部li标签发送到-9999999 text-indent

try putting text-indent to a tag 尝试把文本缩进标签

i hope it work 我希望它能工作

Use 采用

display: block;

for your CSS nav declaration. 用于您的CSS导航声明。 That should fix it :) 那应该解决它:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM