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; : ; }
Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved. 闵涛 E_mail:admin@mintao.net(欢迎提供学习资源)
鄂公网安备 42011102001154号
站长:MinTao ICP备案号:鄂ICP备11006601号-18