下拉菜单

代码:

<!DOCTYPE html>
 <html>
 <head>
 <title></title>
 <meta charset="utf-8">
 <style type="text/css">
 body,nav,ul,li{margin:0px;padding: 0px;}
 body{font-size: 12px;}
 nav{width:448px;height: 40px; margin:50px auto;}
 nav .menu{
 width: 100px;
 height: 40px;
 text-align: center;
 line-height: 40px;
 border: 1px solid red;
 float: left;
 border-right: 0px;
 position: relative;
  
 }
 nav .aa{
 background: url(pic/icon.png) right -958px no-repeat;
 }
 nav .aa:hover{
  
 color: #ffffff;
 background: url(pic/icon.png) right -1035px no-repeat;
 background-color: #C600E6;
  
 }
  
  
 nav .aa:hover ul{
 display: block;
 }
 nav .menu:last-child{border-right: 1px solid red;}
 nav ul {width: 100px; position: absolute;left: -1px;display: none;}
 nav ul li{width: 100px; height: 40px;
 border: 1px solid #ccc;text-align: center;line-height: 40px;border-top:0px; list-style: none;color: #666666;}
 nav ul li:first-child{border-top: 1px solid blue;}
 nav ul li:nth-child(1):hover{
 background: red;color: #ffffff;
 }
 nav ul li:nth-child(2):hover{
 background: green;color: #ffffff;
 }
 nav ul li:nth-child(3):hover{
 background: blue;color: #ffffff;
 }
 nav ul li:nth-child(4):hover{
 background: #ccc;color: #ffffff;
 }
 nav ul li:nth-child(5):hover{
 background:#666666;color: #ffffff;
 }
  
 </style>
 </head>
 <body>
 <nav>
 <div class="menu aa">公司首页
 <ul>
 <li>博客专栏</li>
 <li>博客专家</li>
 <li>排行榜</li>
 <li>观点</li>
 <li>我的博客</li>
 </ul>
 </div>
 <div class="menu aa">我的知识
 <ul>
 <li>博客专栏</li>
 <li>博客专家</li>
 <li>排行榜</li>
 <li>观点</li>
 <li>我的博客</li>
 </ul>
 </div>
 <div class="menu aa">知识库列
 <ul>
 <li>博客专栏</li>
 <li>博客专家</li>
 <li>排行榜</li>
 <li>观点</li>
 <li>我的博客</li>
 </ul>
  
 </div>
 <div class="menu dd">特邀编辑
 <ul>
 <li>博客专栏</li>
 <li>博客专家</li>
 <li>排行榜</li>
 <li>观点</li>
 <li>我的博客</li>
 </ul>
  
 </div>
 </nav>
 </body>
 </html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值