67导航条练习

<!DOCTYPE html>
<html lang="ch">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- 引入重置样式 -->
    <link rel="stylesheet" href="./css/reset.css">
    <!-- 引入图标样式 -->
    <link rel="stylesheet" href="./fontawesome/css/all.css">
    <title>导航条练习</title>
    <style>
        /* 设置整体页面字体 */
        body {
            font-size: 12px;
            font-family: sans-serif;
            background-color: rgba(24, 20, 20, 0.932);
        }

        /* 设置外部容器样式 */
        .top-bar-wrapper {
            width: 100%;
            background-color: rgb(227,228,229);
            line-height: 30px;
            border-bottom: 1px solid #ddd;
        }

        /* 设置内部容器样式 */
        .top-bar {
            margin: 0 auto;
            width: 1190px;
            line-height: 30px;
        }

        /* 设置字体样式 */
        .top-bar a:hover {
            color: rgb(241,2,21);
        }
        .top-bar a,
        .top-bar li {
            text-decoration: none;
            color: rgb(153,153,153);
        }
        .shortcut .hightlight {
            color:rgb(241,2,21);
        }

        /* 设置字体浮动 */
        .shortcut {
            float: right;
        }
        .shortcut li {
            float: left;
        }
        .location {
            float: left;
        }

        /* 设置定位图标样式 */
        .fa-map-marker-alt {
            color: rgb(241,2,21);
            font-size: 13px;
        }

        /* clearfix,解决高度塌陷 */
        .clearfix::before,
        .clearfix::after {
            content: '';
            display: table;
            clear: both;
        }

        /* 设置分割线样式 */
        .line {
            width: 1px;
            height: 10px;
            background-color: rgb(153,153,153);
            margin: 10px 12px;
        }

        /* 做下拉框 */
        /* 鼠标移入location就出现下拉框 */
        .location:hover .map-list {
            display: block;
        }
        .current-city {
            line-height: 29px;
            padding: 0 6px;
            position: relative;
        }
        /* 鼠标移入location就变白色 */
        .location:hover 
        .current-city {
            background-color: white;
            border: 1px solid rgb(204,204,204);
            border-bottom: none;
        }
        /* 鼠标移入location就用伪元素用来遮盖用的 */
        .location:hover 
        .current-city::after {
            content: '';
            display: block;
            width: 100%;
            height: 1px;
            position: absolute;
            left: -1px;
            z-index: 999;
            background-color: white;
            border-left: 1px solid rgb(204,204,204);
            border-right: 1px solid rgb(204,204,204);
        }
        .map-list {
            display: none;
            width: 402px;
            height: 580px;
            background-color: white;
            border: 1px solid rgb(204,204,204);
            /* 脱离文档流 */
            position: absolute;
        }
    </style>
</head>
<body>
    <!-- 创建外围容器 -->
    <div class="top-bar-wrapper">
        <!-- 创建内部容器 -->
        <div class="top-bar clearfix">
            <!-- 左侧的菜单 -->
            <div class="location">
                <div class="current-city">
                    <i class="fa fa-map-marker-alt"></i>
                    <a href="javascript:;">北京</a>
                </div>
                <div class="map-list"></div>
            </div>

            <!-- 右侧的菜单 -->
            <ul class="shortcut">
                <li>
                    <a href="javascript:;">你好,请登录</a>
                    &nbsp;
                    <a href="javascript:;" class="hightlight">免费注册</a>        
                </li>

                <!-- 分割线 -->
                <li class="line"></li>
                <li><a href="javascript:;">我的订单</a></li>

                <li class="line"></li>
                <li>
                    <a href="javascript:;">我的京东</a>
                    <i class="fa fa-angle-down"></i>
                </li>

                <li class="line"></li>
                <li><a href="javascript:;">京东会员</a></li>

                <li class="line"></li>
                <li><a href="javascript:;" class="hightlight">企业采购</a></li>

                <li class="line"></li>
                <li>
                    <span>客户服务</span>
                    <i class="fa fa-angle-down"></i>
                </li>

                <li class="line"></li>
                <li>
                    <span>网站导航</span>
                    <i class="fa fa-angle-down"></i>
                </li>

                <li class="line"></li>
                <li>
                    <span>手机京东</span>
                </li>
            </ul>
        </div>
    </div>
</body>
</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值