淘宝导航条实现-简单下拉框实现

原创 2018-11-24 22:01:04 362
摘要:<!DOCTYPE html> <html> <head>   <meta charset="UTF-8">   <meta name="viewport" content="width=device-width,&
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>淘宝导航条实现-下拉框</title>
  <link rel="stylesheet" type="text/css" href="index.css">
  <link rel="stylesheet" type="text/css" href="font-awesome-4.7.0/css/font-awesome.min.css">
</head>
<body>
  <div>
      <div>
          <div>
          <a href="">中国大陆&nbsp;&nbsp;<i class=" fa fa-angle-down"></i></a>
          <a href="" style="color:#FF5000;">亲,请登录</a>
          <a href="">免费注册</a>
          <a href="">手机逛淘宝</a>
          </div>
          <div>
                <a href="" >我的淘宝<i class=" fa fa-angle-down"></i>
                  <ul>
                    <li >&nbsp;&nbsp;&nbsp;以买到的宝贝</li>
                    <li >&nbsp;&nbsp;&nbsp;我的足迹</li>
                  </ul>
                </a>

                <a href="" ><span class="fa fa-cart-plus" style="color:#FF5000;"></span>&nbsp;&nbsp;购物车</a>
                <a href=""><span class="fa fa-star"></span>收藏夹<i class=" fa fa-angle-down"></i>
                  <ul>
                    <li >&nbsp;&nbsp;&nbsp;收藏的宝贝</li>
                    <li >&nbsp;&nbsp;&nbsp;收藏的店铺</li>
                  </ul>
                </a>
                <a href="">商品分类</a>
                <a href="">买家中心<i class=" fa fa-angle-down"></i>
                  <ul>
                    <li >&nbsp;&nbsp;&nbsp;免费开店</li>
                    <li >&nbsp;&nbsp;&nbsp;已卖出的宝贝</li>
                    <li >&nbsp;&nbsp;&nbsp;出售中的宝贝</li>
                    <li >&nbsp;&nbsp;&nbsp;卖家服务市场</li>
                    <li >&nbsp;&nbsp;&nbsp;卖家培训中心</li>
                    <li >&nbsp;&nbsp;&nbsp;体检中心</li>
                    <li >&nbsp;&nbsp;&nbsp;问商友</li>
                  </ul>
                </a>
                </a>
                <a href="">联系客服<i class=" fa fa-angle-down"></i>
                  <ul>
                    <li >&nbsp;&nbsp;&nbsp;消费者客服</li>
                    <li >&nbsp;&nbsp;&nbsp;卖家客服</li>
                  </ul>
                </a>
                <a href=""><span class="fa fa-align-justify" style="color:#FF5000;"></span>&nbsp;&nbsp;网站导航<i class=" fa fa-angle-down"></i>
                  <ul>
                    <li >以买到的宝贝</li>
                    <li >我的足迹</li>
                    <li >我的足迹</li>
                    <li >我的足迹</li>
                  </ul>
                </a>
          </div>
      </div>
      <div></div>
  </div>
</body>
</html>
    <!-- 通过display: none隐藏元素,再通过 hover选择器显示指定元素,完成类似导航条的效果,类似的效果应该还能应用到很多场合。-->
*{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;height: 40px;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 ui li:hover{background-color: #F5F5F5;}
.header_a ul li{color: #6c6c6c;height: 30px;line-height: 30px;text-align: left;padding: 0px 3px;margin: 5px 0px;font-size: 13px;}


批改老师:查无此人批改时间:2018-11-25 09:27:31
老师总结:嗯,说的对。很多场合都会使用到。主要看你怎么用。加油

发布手记

热门词条