MAC風格的水平導航條(DIV+CSS)

來源:互聯網
上載者:User

1.很普通的一個導航條,不同之處是只採用了一張背景圖片,如左圖。

2.初始狀態:背景為上半部分,翻轉為下半部分,預覽最終效果>>,代碼如下。

#nav{width: 400px;text-align: center;font-size: 11px;font-family: Arial, Helvetica, sans-serif;}#nav ul{margin: 0px;padding: 0px;list-style-type: none;}#nav li{float: left;}#nav li a{text-decoration: none;color: #666666;background: url(img/bg.gif) no-repeat 0px 0px;width: 100px;line-height: 20px;display: block;}#nav li a:hover{color: #CC0000;background: url(img/bg.gif) no-repeat 0px -20px;: ;}

<div id="nav"><ul><li><a href="#">Home</a></li><li><a href="#">About us</a></li> <li><a href="#">Products</a></li><li><a href="#">Services</a></li></ul></div>

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.