简单css下拉菜单效果

Original 2019-02-11 17:23:33 237
abstract:<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title>简单css下拉菜单效果</title>    <style> &nb

<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <title>简单css下拉菜单效果</title>
   <style>
       *{margin: 0;padding: 0}
       a{text-decoration: none;color: #000;font-size: 13px;}
       .clear{clear: both;}
       .header{width: 100%;height: 40px; background-color: #f5f5f5;}
       .content{width: 1200px;margin: 0px auto;line-height: 40px; }
       .content a:hover{color: #ff5000;}
       .left{ height: 40px;float: left}
       .left a{ margin-right: 5px;}
       .right{            width: 700px;height: 40px;float: right;}
       .header_a{display: inline-block;height: 40px;width: 90px;text-align: center;position: relative;}
       .header_a:hover{background-color: #fff; }
       li{list-style: none;}
       .header_a ul{border: 1px solid #f5f5f5; display: none;border-top:none;}
       .header_a:hover ul{display: block;position: absolute;width: 100%;}
       .header_a ul li{color:#6c6c6c;height: 30px;line-height: 30px;text-align: left;padding: 0px 3px; }
       .header_a ul li:hover{background-color: #f5f5f5;}
   </style>
</head>
<body>
<div class="header">
   <div class="content">
       <div class="left">
           <a href="" class="header_a">中国大陆</a>
           <a href="">亲,请登录</a>
           <a href="">免费注册</a>
           <a href="">手机逛淘宝</a>
       </div>
       <div class="right">
           <a href="" class="header_a">我的淘宝
               <ul>
                   <li>已买到的宝贝</li>
                   <li>我的足迹</li>
               </ul>
           </a>
           <a href=""class="header_a">购物车</a>
           <a href=""class="header_a">收藏夹</a>
           <a href=""class="header_a">商品分类</a>
           <a href=""class="header_a">卖家中心</a>
           <a href=""class="header_a">联系客服</a>
           <a href=""class="header_a">网站导航
               <ul>
                   <li>已买到的宝贝</li>
                   <li>我的足迹</li>
                   <li>我的足迹</li>
               </ul>
           </a>
       </div>
   </div>
</div>

</body>
</html>

Correcting teacher:韦小宝Correction time:2019-02-11 17:34:00
Teacher's summary:写的很不错 对于我个人而言我也是比较喜欢使用css来实现下拉菜单 比js实现起来要方便多了

Release Notes

Popular Entries