我的代碼有什麼問題?爲什麼當我懸停在標籤上時,不要在標籤中改變背景。css:懸停在li標籤的跨度
<style type="text/css">
#menu ul{
list-style-type: none;
margin-left: 0px;
padding-left: 0px;
height: 33px;
}
#menu li{
display: inline;
margin-left: 5px;
height: 33px;
}
#menu a{
color: #336699;
height: 33px;
}
#menu a:hover{
color: #FFFFFF;
height: 33px;
background:url(images/mid.gif);
}
#menu li .right{
width: 20px;
}
#menu li .right:hover{
width: 20px;
background:url(images/right.png) no-repeat;
background-position: left top;
}
</style>
<body>
<div id="menu">
<ul>
<li><a href = "">One<span class="right"></span></a></li>
<li><a href = "">Two<span class="right"></span></a></li>
<li><a href = "">Three<span class="right"></span></a></li>
<li><a href = "">Four<span class="right"></span></a></li>
</ul>
</div>
可能是因爲覆蓋跨度? – Hannes 2010-11-12 15:02:27
jsbin.com上的一個實例可以幫助更多 – Sotiris 2010-11-12 15:56:40