学习制作下拉框

原创 2018-12-25 23:06:35 183
摘要:<!DOCTYPE html><html><head>    <meta charset="utf-8">    <title>淘宝导航</title>    <link rel="stylesheet" type=&qu

<!DOCTYPE html>
<html>
<head>
   <meta charset="utf-8">
   <title>淘宝导航</title>
   <link rel="stylesheet" type="text/css" href="css/index.css">
   <link rel="stylesheet" type="text/css" href="css/font-awesome-4.7.0/css/font-awesome.min.css">
</head>
<body>
<div class="header" >
   <div class="header_content" >
       <div class= "header_left">
           <a href="" class="header_a">中国大陆&nbsp; &nbsp; <i class=" fa fa-angle-down"></i></a>
           <a href="" style="color:#FF5000;">亲,请登录</a>
           <a href="">免费注册</a>
           <a href="">手机逛淘宝</a>
    </div>
       <div class="header_right">
           <a href="" class="header_a">我的淘宝<i class=" fa fa-angle-down"></i>
               <ul>
                   <li>已买到的宝只</li>
                   <li>我的足迹</li>
               </ul>
           </a>
           <a href="" class="header_a"><span class=" fa fa-cart-plus" style="color:#FF5000;"></span>购物车&nbsp; &nbsp; </a>
           <a href="" class="header_a"><span class=" fa fa-star"style="color:#FF5000;"></span>收藏夹<i class=" fa fa-angle-down"></i>
               <ul>
                   <li>收藏宝贝</li>
                   <li>收藏的店铺</li>
               </ul>
           </a>
           <a href="" class="header_a">商品分类</a>
           <a href="" class="header_a">卖家中心<i class=" fa fa-angle-down"></i>
               <ul>
                   <li>我的店铺</li>
                   <li>卖家中心</li>
                   <li>出售中的宝贝</li>
                   <li>已售罄</li>
                   <li>收藏宝贝</li>
                   <li>收藏的店铺</li>
               </ul>
           </a>
           <a href="" class="header_a">联系客服<i class=" fa fa-angle-down"></i></a>
           <a href="" class="header_a"><span class=" fa fa-align-justify"style="color:#FF5000;"></span>网站导航<i class=" fa fa-angle-down"></i></a>
       </div>
   </div>
   <div class="clear">
   </div>
   </div>
</body>
</html>






CSS
-------------------------------------------------------------------------------
*{margin: 0px ;padding: 0px;}
a{text-decoration: none ;color:#6c6c6c;font-size: 13px;}
li{list-style: none;}
.clear{clear:both; }
.header{width: 100%; background-color:#F5F5F5; }
.header_content {width: 1200px ;margin: 0px auto; line-height: 40px;}
.header_left{height: 40px ;float: left;}
.header_left a{margin-right: 5px;}
.header_content a:hover{color:#FF5000;}
.header_right{height: 40px;float: right;}
.header_a{dispLay: inline-block ;height: 40px; text-aLign: center ;width: 90px ;position: relative;}
.header_a: hover{background-coLor: #fff;}
.header_a ul{border: 1px solid #F5F5F5;dispLay: none ; border-top: none;}
.header_a:hover ul{dispLay: block ;position: absolute;width: 100px;}
.header_a ul li:hover{background-coLor:#F5F5F5;}
.header_a ul li{coLor: #6c6c6c;height: 30px ;line-height: 30px ;text-align: left;padding: 0px 3px;margin: 5px 0xp;}

批改老师:灭绝师太批改时间:2018-12-26 09:26:05
老师总结:布局完成的不错,代码规范,下次注意一点,带有二级下拉菜单的导航不建议使用a链接嵌套奥!

发布手记

热门词条