简体   繁体   English

为什么css选项卡在ie和firefox中看起来不同

[英]why css tabs look different in ie and firefox

i have created some tabs using css but they look horrible in ie 7. Why? 我已经使用CSS创建了一些标签,但是它们在ie 7中看起来很恐怖。为什么? Here is the html 这是HTML

<ul>
    <li><a href='view.php'>View</a><li>
    <li><a href='logout.php'>Logout</a><li>
    <li><a href='www.google.com'>Search</a><li>
</ul>

and here is the css 这是CSS

ul{list-style:none;height:20px;}
li{background-color:#ff0;float:left;margin:5px;width:60px;text-align:center;display:block;}
li:hover{background-color:#009;}
a{text-decoration:none;}

Here is how it looks in ff 这是ff的样子

在ff中出现

Here is how it looks in ie 这就是它的外观 在此处输入图片说明

You're not terminating your list items correctly. 您没有正确终止列表项。 Try replacing each <li> at the end of the lines with </li> and you should be good. 尝试用</li>替换行末的每个<li> ,您应该会很好。

Have you tried a reset CSS like : 您是否尝试过重置CSS:

http://meyerweb.com/eric/tools/css/reset/ http://meyerweb.com/eric/tools/css/reset/

It could be appreciable... 这可能是可观的...

Edit 编辑

@Kaivosukeltaja is right : @Kaivosukeltaja是正确的:

<li>...</li>

Will fix your problem. 将解决您的问题。 But you can let the CSS reset on your page ;) 但是您可以在页面上让CSS重置;)

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

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