0
我有一些代碼和IE7瀏覽器,它的垂直CATEGORY菜單與ul標記和css屬性製成的菜單有問題。正常工作與Safari瀏覽器,IE8,火狐3.5和3.6,但IE7的一個大的左邊距正在創建這是由服務器生成的代碼:css html ie7(ul和li標籤)菜單問題
<div id="menu">
<ul><li><a class="level1" href="catalog.html?category=21">PRODUCTOS</a></li>
<li><a class="level1" href="catalog.html?category=21">Daniela Kosan</a></li>
<li><a class="level2" href="catalog.html?category=21">Lo Nuevo</a></li>
<li><a class="level2" href="catalog.html?category=22">Fragancias</a></li>
<li><a class="level2" href="catalog.html?category=23">Rostro</a></li>
<li><a class="level2" href="catalog.html?category=24">Accesorios</a></li></ul>
</div>
,這是我使用的CSS:
* { margin-top:0; 填充:0; }
#menu{
background:#fff;
width:205px;
padding-left:9px;
}
#menu ul{
list-style:none;
}
#menu li{
list-style:none;
}
#menu li a{
list-style:none;
font-family: arial, sans-serif;
background:#F0CFD6;
color:#944862;
text-transform:none;
font-size:14px;
font-weight:normal;
text-decoration:none;
display:block;
}
#menu li a:hover{
color:#fff;
text-decoration:none;
}
#menu li a.level1{
padding-left:10px;
padding-top:10px;
width:205px;
height:20px;
color:#fff;
background:#DA8298;
}
#menu li a:hover.level1{
color:#000;
}
#menu li a.level2{
padding-left:20px;
padding-top:12px;
width:205px;
height:20px;
color:#8B5169;
border-width:0 0px 0px 0px;
background:#F0CFD6;
border-bottom:1px dashed #CEABB2;
}
#menu li a:hover.level2{
color:#000;
}
這裏是不好使,請注意大的左緣除了類別菜單
這是如何呈現在其他瀏覽器...好!感謝你們!
你爲什麼只重設`margin-top`?爲什麼不能`* {margin:0;填充:0; ``? – Andre 2011-01-19 17:19:25
嗯,我需要爲整個容器留下一個填充,使其與設計相匹配。我在下面的答案中添加了該標籤,並且它能夠正常工作,所以非常感謝! – Ernest 2011-01-19 20:03:04