HTML:
<ul class="nav">
<li><a href="" class="cur"><span>首页</span></a></li>
<li><a href=""><span>杂谈</span></a></li>
<li><a href=""><span>科技</span></a></li>
</ul>
.nav a{ float:left; height:24px; line-height: 24px;display: block; overflow: hidden; padding-right:10px;}
.nav a span{ float:left; height:24px; line-height: 24px;padding-left:10px;}
.nav a:hover{ background-position:100% 0; text-decoration: none;}
时间: 2024-09-18 19:52:52