开发者

why css tabs look different in ie and firefox

i have created some tabs using css but they look horrible in ie 7. Why? Here is the html

<ul>
    <li><a href='view.php'>View</a><li>
    <li><a href='logout.php'>Logout<开发者_JS百科;/a><li>
    <li><a href='www.google.com'>Search</a><li>
</ul>

and here is the 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

why css tabs look different in ie and firefox

Here is how it looks in ie

why css tabs look different in ie and firefox


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.


Have you tried a reset CSS like :

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

It could be appreciable...

Edit

@Kaivosukeltaja is right :

<li>...</li>

Will fix your problem. But you can let the CSS reset on your page ;)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜