移动端布局之flex布局3:案例-携程网首页案例制作(曾经的版本)2

news2025/7/19 3:54:15

移动端布局之flex布局3

  • 案例:携程网首页案例制作(曾经的版本)
    • 背景线性渐变
      • index.html
      • index.css
    • 侧导航栏
      • index.html
      • index.css
    • 热门活动模块制作
      • index.html
      • index.css

案例:携程网首页案例制作(曾经的版本)

背景线性渐变

background:linear-gradient(起始方向,颜色1,颜色2,…);
background: -webkit-linear-gradient(left,red,blue);
background: -webkit-linear-gradient(left top,red,blue);

背景渐变必须添加浏览器私有前缀
起始方向可以是:方位名词 或者度数,如果省略就是top

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div{
            width: 800px;
            height: 200px;
            /*背景渐变必须添加浏览器私有前缀*/
            background: -webkit-linear-gradient(left,red,blue);
        }
    </style>
</head>
<body>
<div></div>
</body>
</html>

在这里插入图片描述

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div{
            width: 800px;
            height: 200px;
            /*背景渐变必须添加浏览器私有前缀*/
            /*background: -webkit-linear-gradient(left,red,blue);*/
            background: -webkit-linear-gradient(45deg,red,blue);
        }
    </style>
</head>
<body>
<div></div>
</body>
</html>

在这里插入图片描述

index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>携程在手,收走就走</title>
    <meta name="viewport" content="width=device-width,user-scalable=no,
    initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0">
    <link rel="stylesheet" href="css/normalize.css">
    <link rel="stylesheet" href="css/index.css">
</head>
<body>
    <!--顶部搜索-->
    <div class="search-index">
        <div class="search">观音桥步行街门票·酒店·美食</div>
        <a href="#" class="user">旅游地图</a>
    </div>
    <!--焦点图模块-->
    <div class="focus">
        <img src="./upload/focus.jpg" alt="">
    </div>
    <!--局部导航栏-->
    <ul class="local-nav">
        <li>
            <a href="#" title="景点·玩乐">
                <span class="local-nav-icon-icon1"></span>
                <span>景点·玩乐</span>
            </a>
        </li>
        <li>
            <a href="#" title="周边游">
                <span class="local-nav-icon-icon2"></span>
                <span>周边游</span>
            </a>
        </li>
        <li>
            <a href="#" title="美食林">
                <span class="local-nav-icon-icon3"></span>
                <span>美食林</span>
            </a>
        </li>
        <li>
            <a href="#" title="一日游">
                <span class="local-nav-icon-icon4"></span>
                <span>一日游</span>
            </a>
        </li>
        <li>
            <a href="#" title="当地攻略">
                <span class="local-nav-icon-icon5"></span>
                <span>当地攻略</span>
            </a>
        </li>
    </ul>
    <!--主导航栏-->
    <nav>
        <div class="nav-common">
            <div class="nav-items">
                <a href="#">海外酒店</a>
            </div>
            <div class="nav-items">
                <a href="#">海外酒店</a>
                <a href="#">特价酒店</a>
            </div>
            <div class="nav-items">
                <a href="#">团购</a>
                <a href="#">民宿·客栈</a>
            </div>
        </div>
        <div class="nav-common">
            <div class="nav-items">
                <a href="#">机票</a>
            </div>
            <div class="nav-items">
                <a href="#">火车票</a>
                <a href="#">特价机票</a>
            </div>
            <div class="nav-items">
                <a href="#">汽车票·船票</a>
                <a href="#">专车·租车</a>
            </div>
        </div>
        <div class="nav-common">
            <div class="nav-items">
                <a href="#">旅游</a>
            </div>
            <div class="nav-items">
                <a href="#">门票</a>
                <a href="#">目的地攻略</a>
            </div>
            <div class="nav-items">
                <a href="#">邮轮旅行</a>
                <a href="#">定制旅行</a>
            </div>
        </div>
    </nav>
</body>
</html>

index.css

body{
    max-width: 540px;
    min-width: 320px;
    margin: 0 auto;
    background-color: #f2f2f2;
    font: normal 16px/1.5 PingFangSC-regular,Tahoma,Lucida Grande,Verdana,Microsoft Yahei,STXihei,hei;
    color: #000;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    font-size: 14px;
}
ul{
    list-style: none;
    /*ul有默认的padding和margin值*/
    padding: 0;
    margin: 0;
}
a{
    text-decoration: none;
    color: #222;
}
div{
    box-sizing: border-box;
}
/*搜索模块*/
.search-index{
    /*固定定位跟父级没有关系,它以屏幕为主*/
    position: fixed;
    top: 0;
    /*居中对齐*/
    left: 50%;
    transform: translateX(-50%);
    /*固定的盒子应该有宽度*/
    width: 100%;
    max-width: 540px;
    min-width: 320px;
    height: 44px;
    background: linear-gradient(to right,#2fa2ff,#2285fa);
    display: flex;
}
.search{
    flex: 1;
    height: 26px;
    background-color: #fff;
    margin: 7px 10px;
    border-radius: 15px;
    position: relative;
    font-size: 12px;
    line-height: 26px;
    padding-left: 10px;
    color: #666;
}
.search::after{
    position: absolute;
    top: 1px;
    right: 1px;
    content: "搜索";
    width: 45px;
    height: 24px;
    font-size: 12px;
    border-radius: 15px;
    background: linear-gradient(to right,#33c6fc,#3fabff);
    text-align: center;
    line-height: 24px;
    color: #fff;
}
.user{
    width: 50px;
    height: 44px;
    font-size: 12px;
    color: #fff;
    text-align: center;
    /*background-color: mediumpurple;*/
}
.user::before{
    content: "";
    display: block;
    width: 24px;
    height: 24px;
    background: url(../images/map.png) no-repeat;
    background-size: 24px;
    margin: 0 auto;
}
/*focus*/
.focus{
    margin: 50px 10px 0;
}
.focus img{
    width: 100%;
    border-radius: 10px;
}
/*局部导航栏*/
.local-nav{
    height: 64px;
    margin: 3px 4px;
    background-color: #fff;
    border-radius: 8px;
    display: flex;
}
.local-nav li{
    flex: 1;
}
.local-nav a{
    display: flex;
    flex-direction: column;
    /*侧轴居中对齐,因为是单行*/
    align-items: center;
}
/*使用属性选择器对各个图片进行替换*/
.local-nav li [class^="local-nav-icon"]{
    margin-top: 8px;
    width: 32px;
    height: 32px;
    background: url(../images/localnav_bg.png) no-repeat 0 0;
    background-size: 32px auto;
}
.local-nav li .local-nav-icon-icon2{
    background-position: 0 -32px;
}
.local-nav li .local-nav-icon-icon3{
    background-position: 0 -64px;
}
.local-nav li .local-nav-icon-icon4{
    background-position: 0 -96px;
}
.local-nav li .local-nav-icon-icon5{
    background-position: 0 -128px;
}
/*nav*/
nav{
    overflow:hidden;
    border-radius: 8px;
    margin: 0 4px 3px;
}
.nav-common{
    height: 88px;
    background-color: pink;
    display: flex;
}
.nav-common:nth-child(2){
    margin: 3px 0;
}
.nav-items{
    /*子也可以当父成为flex容器*/
    flex: 1;
    display: flex;
    flex-direction: column;
}
/*-n+2就是选择前两个,n+2是从第二个开始*/
.nav-items:nth-child(-n+2){
    border-right: 1px solid #fff;
}
.nav-items a{
    flex: 1;
    line-height: 44px;
    text-align: center;
    color: #ffff;
    /*文字阴影*/
    text-shadow: 1px 1px rgba(0,0,0,0.2);
}
.nav-items a:nth-child(1){
    border-bottom: 1px solid #fff;
}
.nav-items:nth-child(1) a{
    border-bottom: 0;
    background: url(../images/hotel.png) no-repeat bottom center;
    background-size: 121px auto;
}
.nav-common:nth-child(1){
    background: -webkit-linear-gradient(left,#fa5a55,#fa994d);
}
.nav-common:nth-child(2){
    background: -webkit-linear-gradient(left,#4b90ed,#53bced);
}
.nav-common:nth-child(3){
    background: -webkit-linear-gradient(left,#34c2a9,#6cd559);
}

在这里插入图片描述

侧导航栏

index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>携程在手,收走就走</title>
    <meta name="viewport" content="width=device-width,user-scalable=no,
    initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0">
    <link rel="stylesheet" href="css/normalize.css">
    <link rel="stylesheet" href="css/index.css">
</head>
<body>
<!--顶部搜索-->
<div class="search-index">
    <div class="search">观音桥步行街门票·酒店·美食</div>
    <a href="#" class="user">旅游地图</a>
</div>
<!--焦点图模块-->
<div class="focus">
    <img src="./upload/focus.jpg" alt="">
</div>
<!--局部导航栏-->
<ul class="local-nav">
    <li>
        <a href="#" title="景点·玩乐">
            <span class="local-nav-icon-icon1"></span>
            <span>景点·玩乐</span>
        </a>
    </li>
    <li>
        <a href="#" title="周边游">
            <span class="local-nav-icon-icon2"></span>
            <span>周边游</span>
        </a>
    </li>
    <li>
        <a href="#" title="美食林">
            <span class="local-nav-icon-icon3"></span>
            <span>美食林</span>
        </a>
    </li>
    <li>
        <a href="#" title="一日游">
            <span class="local-nav-icon-icon4"></span>
            <span>一日游</span>
        </a>
    </li>
    <li>
        <a href="#" title="当地攻略">
            <span class="local-nav-icon-icon5"></span>
            <span>当地攻略</span>
        </a>
    </li>
</ul>
<!--主导航栏-->
<nav>
    <div class="nav-common">
        <div class="nav-items">
            <a href="#">海外酒店</a>
        </div>
        <div class="nav-items">
            <a href="#">海外酒店</a>
            <a href="#">特价酒店</a>
        </div>
        <div class="nav-items">
            <a href="#">团购</a>
            <a href="#">民宿·客栈</a>
        </div>
    </div>
    <div class="nav-common">
        <div class="nav-items">
            <a href="#">机票</a>
        </div>
        <div class="nav-items">
            <a href="#">火车票</a>
            <a href="#">特价机票</a>
        </div>
        <div class="nav-items">
            <a href="#">汽车票·船票</a>
            <a href="#">专车·租车</a>
        </div>
    </div>
    <div class="nav-common">
        <div class="nav-items">
            <a href="#">旅游</a>
        </div>
        <div class="nav-items">
            <a href="#">门票</a>
            <a href="#">目的地攻略</a>
        </div>
        <div class="nav-items">
            <a href="#">邮轮旅行</a>
            <a href="#">定制旅行</a>
        </div>
    </div>
</nav>
<!--侧导航栏-->
<ul class="subnav-entry">
    <li>
        <a href="#">
            <span class="subnav-entry-icon-icon1"></span>
            <span>wifi电话卡</span>
        </a>
    </li>
    <li>
        <a href="#">
            <span class="subnav-entry-icon-icon2"></span>
            <span>wifi电话卡</span>
        </a>
    </li>
    <li>
        <a href="#">
            <span class="subnav-entry-icon-icon3"></span>
            <span>wifi电话卡</span>
        </a>
    </li>
    <li>
        <a href="#">
            <span class="subnav-entry-icon-icon4"></span>
            <span>wifi电话卡</span>
        </a>
    </li>
    <li>
        <a href="#">
            <span class="subnav-entry-icon-icon5"></span>
            <span>wifi电话卡</span>
        </a>
    </li>
    <li>
        <a href="#">
            <span class="subnav-entry-icon-icon6"></span>
            <span>wifi电话卡</span>
        </a>
    </li>
    <li>
        <a href="#">
            <span class="subnav-entry-icon-icon7"></span>
            <span>wifi电话卡</span>
        </a>
    </li>
    <li>
        <a href="#">
            <span class="subnav-entry-icon-icon8"></span>
            <span>wifi电话卡</span>
        </a>
    </li>
    <li>
        <a href="#">
            <span class="subnav-entry-icon-icon9"></span>
            <span>wifi电话卡</span>
        </a>
    </li>
    <li>
        <a href="#">
            <span class="subnav-entry-icon-icon10"></span>
            <span>wifi电话卡</span>
        </a>
    </li>
</ul>
</body>
</html>

index.css

body{
    max-width: 540px;
    min-width: 320px;
    margin: 0 auto;
    background-color: #f2f2f2;
    font: normal 16px/1.5 PingFangSC-regular,Tahoma,Lucida Grande,Verdana,Microsoft Yahei,STXihei,hei;
    color: #000;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    font-size: 14px;
}
ul{
    list-style: none;
    /*ul有默认的padding和margin值*/
    padding: 0;
    margin: 0;
}
a{
    text-decoration: none;
    color: #222;
}
div{
    box-sizing: border-box;
}
/*搜索模块*/
.search-index{
    /*固定定位跟父级没有关系,它以屏幕为主*/
    position: fixed;
    top: 0;
    /*居中对齐*/
    left: 50%;
    transform: translateX(-50%);
    /*固定的盒子应该有宽度*/
    width: 100%;
    max-width: 540px;
    min-width: 320px;
    height: 44px;
    background: linear-gradient(to right,#2fa2ff,#2285fa);
    display: flex;
}
.search{
    flex: 1;
    height: 26px;
    background-color: #fff;
    margin: 7px 10px;
    border-radius: 15px;
    position: relative;
    font-size: 12px;
    line-height: 26px;
    padding-left: 10px;
    color: #666;
}
.search::after{
    position: absolute;
    top: 1px;
    right: 1px;
    content: "搜索";
    width: 45px;
    height: 24px;
    font-size: 12px;
    border-radius: 15px;
    background: linear-gradient(to right,#33c6fc,#3fabff);
    text-align: center;
    line-height: 24px;
    color: #fff;
}
.user{
    width: 50px;
    height: 44px;
    font-size: 12px;
    color: #fff;
    text-align: center;
    /*background-color: mediumpurple;*/
}
.user::before{
    content: "";
    display: block;
    width: 24px;
    height: 24px;
    background: url(../images/map.png) no-repeat;
    background-size: 24px;
    margin: 0 auto;
}
/*focus*/
.focus{
    margin: 50px 10px 0;
}
.focus img{
    width: 100%;
    border-radius: 10px;
}
/*局部导航栏*/
.local-nav{
    height: 64px;
    margin: 3px 4px;
    background-color: #fff;
    border-radius: 8px;
    display: flex;
}
.local-nav li{
    flex: 1;
}
.local-nav a{
    display: flex;
    flex-direction: column;
    /*侧轴居中对齐,因为是单行*/
    align-items: center;
}
/*使用属性选择器对各个图片进行替换*/
.local-nav li [class^="local-nav-icon"]{
    margin-top: 8px;
    width: 32px;
    height: 32px;
    background: url(../images/localnav_bg.png) no-repeat 0 0;
    background-size: 32px auto;
}
.local-nav li .local-nav-icon-icon2{
    background-position: 0 -32px;
}
.local-nav li .local-nav-icon-icon3{
    background-position: 0 -64px;
}
.local-nav li .local-nav-icon-icon4{
    background-position: 0 -96px;
}
.local-nav li .local-nav-icon-icon5{
    background-position: 0 -128px;
}
/*nav*/
nav{
    overflow:hidden;
    border-radius: 8px;
    margin: 0 4px 3px;
}
.nav-common{
    height: 88px;
    background-color: pink;
    display: flex;
}
.nav-common:nth-child(2){
    margin: 3px 0;
}
.nav-items{
    /*子也可以当父成为flex容器*/
    flex: 1;
    display: flex;
    flex-direction: column;
}
/*-n+2就是选择前两个,n+2是从第二个开始*/
.nav-items:nth-child(-n+2){
    border-right: 1px solid #fff;
}
.nav-items a{
    flex: 1;
    line-height: 44px;
    text-align: center;
    color: #ffff;
    /*文字阴影*/
    text-shadow: 1px 1px rgba(0,0,0,0.2);
}
.nav-items a:nth-child(1){
    border-bottom: 1px solid #fff;
}
.nav-items:nth-child(1) a{
    border-bottom: 0;
    background: url(../images/hotel.png) no-repeat bottom center;
    background-size: 121px auto;
}
.nav-common:nth-child(1){
    background: -webkit-linear-gradient(left,#fa5a55,#fa994d);
}
.nav-common:nth-child(2){
    background: -webkit-linear-gradient(left,#4b90ed,#53bced);
}
.nav-common:nth-child(3){
    background: -webkit-linear-gradient(left,#34c2a9,#6cd559);
}
/*侧导航栏*/
.subnav-entry{
    border-radius: 8px;
    background-color: #fff;
    margin: 0 4px;
    display: flex;
    flex-wrap: wrap;
    padding: 5px 0;
}
.subnav-entry li{
    /*里面的子盒子可以写%相对于父亲来说*/
    flex: 20%;
}
.subnav-entry a{
    display: flex;
    flex-direction: column;
    align-items: center;
}
.subnav-entry li [class^="subnav-entry-icon"]{
    margin-top: 4px;
    width: 28px;
    height: 28px;
    background: url("../images/subnav-bg.png") no-repeat 0 0;
    background-size: 28px auto;
}
.subnav-entry li .subnav-entry-icon-icon2{
    background-position: 0 -30px;
}
.subnav-entry li .subnav-entry-icon-icon3{
    background-position: 0 -65px;
}
.subnav-entry li .subnav-entry-icon-icon4{
     background-position: 0 -322px;
 }
.subnav-entry li .subnav-entry-icon-icon5{
    background-position: 0 -100px;
}

.subnav-entry li .subnav-entry-icon-icon6{
    background-position: 5px -160px;
}
.subnav-entry li .subnav-entry-icon-icon7{
    background-position: 0 -195px;
}
.subnav-entry li .subnav-entry-icon-icon8{
    background-position: 0 -130px;
}
.subnav-entry li .subnav-entry-icon-icon9{
    background-position: 0 -230px;
}
.subnav-entry li .subnav-entry-icon-icon10{
    background-position: 5px -288px;
}

在这里插入图片描述

热门活动模块制作

index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>携程在手,收走就走</title>
    <meta name="viewport" content="width=device-width,user-scalable=no,
    initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0">
    <link rel="stylesheet" href="css/normalize.css">
    <link rel="stylesheet" href="css/index.css">
</head>
<body>
    <!--顶部搜索-->
    <div class="search-index">
        <div class="search">观音桥步行街门票·酒店·美食</div>
        <a href="#" class="user">旅游地图</a>
    </div>
    <!--焦点图模块-->
    <div class="focus">
        <img src="./upload/focus.jpg" alt="">
    </div>
    <!--局部导航栏-->
    <ul class="local-nav">
        <li>
            <a href="#" title="景点·玩乐">
                <span class="local-nav-icon-icon1"></span>
                <span>景点·玩乐</span>
            </a>
        </li>
        <li>
            <a href="#" title="周边游">
                <span class="local-nav-icon-icon2"></span>
                <span>周边游</span>
            </a>
        </li>
        <li>
            <a href="#" title="美食林">
                <span class="local-nav-icon-icon3"></span>
                <span>美食林</span>
            </a>
        </li>
        <li>
            <a href="#" title="一日游">
                <span class="local-nav-icon-icon4"></span>
                <span>一日游</span>
            </a>
        </li>
        <li>
            <a href="#" title="当地攻略">
                <span class="local-nav-icon-icon5"></span>
                <span>当地攻略</span>
            </a>
        </li>
    </ul>
    <!--主导航栏-->
    <nav>
        <div class="nav-common">
            <div class="nav-items">
                <a href="#">海外酒店</a>
            </div>
            <div class="nav-items">
                <a href="#">海外酒店</a>
                <a href="#">特价酒店</a>
            </div>
            <div class="nav-items">
                <a href="#">团购</a>
                <a href="#">民宿·客栈</a>
            </div>
        </div>
        <div class="nav-common">
            <div class="nav-items">
                <a href="#">机票</a>
            </div>
            <div class="nav-items">
                <a href="#">火车票</a>
                <a href="#">特价机票</a>
            </div>
            <div class="nav-items">
                <a href="#">汽车票·船票</a>
                <a href="#">专车·租车</a>
            </div>
        </div>
        <div class="nav-common">
            <div class="nav-items">
                <a href="#">旅游</a>
            </div>
            <div class="nav-items">
                <a href="#">门票</a>
                <a href="#">目的地攻略</a>
            </div>
            <div class="nav-items">
                <a href="#">邮轮旅行</a>
                <a href="#">定制旅行</a>
            </div>
        </div>
    </nav>
    <!--侧导航栏-->
    <ul class="subnav-entry">
        <li>
            <a href="#">
                <span class="subnav-entry-icon-icon1"></span>
                <span>wifi电话卡</span>
            </a>
        </li>
        <li>
            <a href="#">
                <span class="subnav-entry-icon-icon2"></span>
                <span>wifi电话卡</span>
            </a>
        </li>
        <li>
            <a href="#">
                <span class="subnav-entry-icon-icon3"></span>
                <span>wifi电话卡</span>
            </a>
        </li>
        <li>
            <a href="#">
                <span class="subnav-entry-icon-icon4"></span>
                <span>wifi电话卡</span>
            </a>
        </li>
        <li>
            <a href="#">
                <span class="subnav-entry-icon-icon5"></span>
                <span>wifi电话卡</span>
            </a>
        </li>
        <li>
            <a href="#">
                <span class="subnav-entry-icon-icon6"></span>
                <span>wifi电话卡</span>
            </a>
        </li>
        <li>
            <a href="#">
                <span class="subnav-entry-icon-icon7"></span>
                <span>wifi电话卡</span>
            </a>
        </li>
        <li>
            <a href="#">
                <span class="subnav-entry-icon-icon8"></span>
                <span>wifi电话卡</span>
            </a>
        </li>
        <li>
            <a href="#">
                <span class="subnav-entry-icon-icon9"></span>
                <span>wifi电话卡</span>
            </a>
        </li>
        <li>
            <a href="#">
                <span class="subnav-entry-icon-icon10"></span>
                <span>wifi电话卡</span>
            </a>
        </li>
    </ul>
    <!--销售模块-->
    <div class="sales-box">
        <div class="sales-hd">
            <h2>热门活动</h2>
            <a href="#">更多</a>
        </div>
    </div>
</body>
</html>

index.css

body{
    max-width: 540px;
    min-width: 320px;
    margin: 0 auto;
    background-color: #f2f2f2;
    font: normal 16px/1.5 PingFangSC-regular,Tahoma,Lucida Grande,Verdana,Microsoft Yahei,STXihei,hei;
    color: #000;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    font-size: 14px;
}
ul{
    list-style: none;
    /*ul有默认的padding和margin值*/
    padding: 0;
    margin: 0;
}
a{
    text-decoration: none;
    color: #222;
}
div{
    box-sizing: border-box;
}
/*搜索模块*/
.search-index{
    /*固定定位跟父级没有关系,它以屏幕为主*/
    position: fixed;
    top: 0;
    /*居中对齐*/
    left: 50%;
    transform: translateX(-50%);
    /*固定的盒子应该有宽度*/
    width: 100%;
    max-width: 540px;
    min-width: 320px;
    height: 44px;
    background: linear-gradient(to right,#2fa2ff,#2285fa);
    display: flex;
}
.search{
    flex: 1;
    height: 26px;
    background-color: #fff;
    margin: 7px 10px;
    border-radius: 15px;
    position: relative;
    font-size: 12px;
    line-height: 26px;
    padding-left: 10px;
    color: #666;
}
.search::after{
    position: absolute;
    top: 1px;
    right: 1px;
    content: "搜索";
    width: 45px;
    height: 24px;
    font-size: 12px;
    border-radius: 15px;
    background: linear-gradient(to right,#33c6fc,#3fabff);
    text-align: center;
    line-height: 24px;
    color: #fff;
}
.user{
    width: 50px;
    height: 44px;
    font-size: 12px;
    color: #fff;
    text-align: center;
    /*background-color: mediumpurple;*/
}
.user::before{
    content: "";
    display: block;
    width: 24px;
    height: 24px;
    background: url(../images/map.png) no-repeat;
    background-size: 24px;
    margin: 0 auto;
}
/*focus*/
.focus{
    margin: 50px 10px 0;
}
.focus img{
    width: 100%;
    border-radius: 10px;
}
/*局部导航栏*/
.local-nav{
    height: 64px;
    margin: 3px 4px;
    background-color: #fff;
    border-radius: 8px;
    display: flex;
}
.local-nav li{
    flex: 1;
}
.local-nav a{
    display: flex;
    flex-direction: column;
    /*侧轴居中对齐,因为是单行*/
    align-items: center;
}
/*使用属性选择器对各个图片进行替换*/
.local-nav li [class^="local-nav-icon"]{
    margin-top: 8px;
    width: 32px;
    height: 32px;
    background: url(../images/localnav_bg.png) no-repeat 0 0;
    background-size: 32px auto;
}
.local-nav li .local-nav-icon-icon2{
    background-position: 0 -32px;
}
.local-nav li .local-nav-icon-icon3{
    background-position: 0 -64px;
}
.local-nav li .local-nav-icon-icon4{
    background-position: 0 -96px;
}
.local-nav li .local-nav-icon-icon5{
    background-position: 0 -128px;
}
/*nav*/
nav{
    overflow:hidden;
    border-radius: 8px;
    margin: 0 4px 3px;
}
.nav-common{
    height: 88px;
    background-color: pink;
    display: flex;
}
.nav-common:nth-child(2){
    margin: 3px 0;
}
.nav-items{
    /*子也可以当父成为flex容器*/
    flex: 1;
    display: flex;
    flex-direction: column;
}
/*-n+2就是选择前两个,n+2是从第二个开始*/
.nav-items:nth-child(-n+2){
    border-right: 1px solid #fff;
}
.nav-items a{
    flex: 1;
    line-height: 44px;
    text-align: center;
    color: #ffff;
    /*文字阴影*/
    text-shadow: 1px 1px rgba(0,0,0,0.2);
}
.nav-items a:nth-child(1){
    border-bottom: 1px solid #fff;
}
.nav-items:nth-child(1) a{
    border-bottom: 0;
    background: url(../images/hotel.png) no-repeat bottom center;
    background-size: 121px auto;
}
.nav-common:nth-child(1){
    background: -webkit-linear-gradient(left,#fa5a55,#fa994d);
}
.nav-common:nth-child(2){
    background: -webkit-linear-gradient(left,#4b90ed,#53bced);
}
.nav-common:nth-child(3){
    background: -webkit-linear-gradient(left,#34c2a9,#6cd559);
}
/*侧导航栏*/
.subnav-entry{
    border-radius: 8px;
    background-color: #fff;
    margin: 0 4px;
    display: flex;
    flex-wrap: wrap;
    padding: 5px 0;
}
.subnav-entry li{
    /*里面的子盒子可以写%相对于父亲来说*/
    flex: 20%;
}
.subnav-entry a{
    display: flex;
    flex-direction: column;
    align-items: center;
}
.subnav-entry li [class^="subnav-entry-icon"]{
    margin-top: 4px;
    width: 28px;
    height: 28px;
    background: url("../images/subnav-bg.png") no-repeat 0 0;
    background-size: 28px auto;
}
.subnav-entry li .subnav-entry-icon-icon2{
    background-position: 0 -30px;
}
.subnav-entry li .subnav-entry-icon-icon3{
    background-position: 0 -65px;
}
.subnav-entry li .subnav-entry-icon-icon4{
     background-position: 0 -322px;
 }
.subnav-entry li .subnav-entry-icon-icon5{
    background-position: 0 -100px;
}

.subnav-entry li .subnav-entry-icon-icon6{
    background-position: 5px -160px;
}
.subnav-entry li .subnav-entry-icon-icon7{
    background-position: 0 -195px;
}
.subnav-entry li .subnav-entry-icon-icon8{
    background-position: 0 -130px;
}
.subnav-entry li .subnav-entry-icon-icon9{
    background-position: 0 -230px;
}
.subnav-entry li .subnav-entry-icon-icon10{
    background-position: 5px -288px;
}
/*sales-box*/
.sales-box{
    border-top: 1px solid #bbb;
    background-color: #fff;
    margin: 4px;
}
.sales-hd{
    height: 44px;
    border-bottom:1px solid #ccc
}
.sales-hd h2{
    /*文字缩进*/
    text-indent: -999px;
    overflow: hidden;
    position: relative;
}
.sales-hd h2::after{
    content: "";
    position: absolute;
    top: 8px;
    left: 20px;
    width: 79px;
    height: 15px;
    background: url(../images/hot.png) no-repeat 0 -20px;
    background-size: 79px auto;
}

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/619479.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

简单三步,教你快速接入淘宝开放平台,调用官方API

淘宝开放平台是为了方便开发者接入淘宝平台&#xff0c;进行商品、订单等信息的管理和交互而设计的。接入淘宝开放平台需要经过一系列审核和申请流程&#xff0c;而在API权限包审核时&#xff0c;一定要提供真实有效的证件和资料&#xff0c;并满足相应的条件&#xff0c;才能顺…

Redis未授权访问漏洞复现与利用

目录 一、漏洞简介及危害 1.1什么是redis未授权访问 1.2漏洞的危害&#xff1a; 1.3漏洞影响&#xff1a; 二、漏洞复现&#xff1a; 三、未授权访问漏洞测试 3.1 利用redis写webshell 3.2 利用"公私钥"认证获取root权限 3.3 利用crontab反弹shell 四、脚本…

自动化10年+经验给你10条建议,让你在自动化界占据一片地!

目录 前言&#xff1a; 1、哪一刻&#xff0c;让你想起了自动化 1.1 执行回归测试 1.2 压测场景执行并发 1.3 UI稳定&#xff0c;接口不断升级 2、七问&#xff1a;是否了解自动化风险 2.1 团队成员的资历 2.2 自动化成本投入产出比 2.3 慎重对待UI级自动化 2.4 自动化…

OpenAI | Let’s Verify Step by Step详细解读

一、概述 title&#xff1a;Let’s Verify Step by Step 论文地址&#xff1a;https://arxiv.org/abs/2305.20050 代码&#xff1a;GitHub - openai/prm800k: 800,000 step-level correctness labels on LLM solutions to MATH problems 1.1 Motivation 近期大模型的出现极…

青岛科技大学|物联网工程|物联网定位技术(第一讲)|6.7

目录 物联网定位技术&#xff08;第一讲&#xff09; 1. 什么是物联网定位技术&#xff1f; 2. 物联网定位技术主要有哪些&#xff1f; 3. 简述卫星定位系统的发展历史以及GPS的发展概况&#xff1f; &#xff08;1&#xff09;卫星定位的由来和发展 &#xff08;2&…

【Mysql】InnoDB 中 B+ 树索引的注意事项

一、根页面万年不动 在之前的文章里&#xff0c;为了方便理解&#xff0c;都是先画存储用户记录的叶子节点&#xff0c;然后再画出存储目录项记录的内节点。 但实际上 B 树的行成过程是这样的&#xff1a; 每当为某个表创建一个 B 树索引&#xff0c;都会为这个索引创建一个根…

Vue.js 中的服务端渲染和客户端渲染的区别

Vue.js 中的服务端渲染和客户端渲染的区别 Vue.js 是一个流行的前端框架&#xff0c;它提供了一种简单而强大的方式来构建交互式用户界面。Vue.js 可以在客户端和服务端执行渲染&#xff0c;这两种方式有不同的优势和劣势。本文将介绍 Vue.js 中的服务端渲染和客户端渲染的区别…

安全测试:13款免费的安全测试工具,抓紧白嫖不看后悔

目录 1. Excercise in a Box 2. Needle 3. DevSlop 4.移动安全框架(Mobile Security Framework) 5. Frida 6. Nishang 7.Tamper 8.InSpec 9. Faraday 10. Pocsuite 11. Taipan 12.Pacu 13. Secure Guilld 总结 1. Excercise in a Box Excercise in a Box是由英国…

Vue2 前端路由

SPA 单页面应用 只有一个页面&#xff08;一个html文件&#xff09; vue-router 组件之间的切换&#xff08;hash地址与组件间的关系&#xff09;–前端路由 vue版本与路由版本的对应关系 vue2->router3 vue3->router4 入门 用vue脚手架创建只有babel组件的vue项目…

Vue.js 中的 mixin 和混入有什么区别?

Vue.js 中的 mixin 和混入有什么区别&#xff1f; 在 Vue.js 中&#xff0c;mixin 和混入是两个常用的概念&#xff0c;它们可以帮助我们实现代码的复用和组件间的通信。虽然它们的名字很相似&#xff0c;但它们的作用和用法有所不同。本文将介绍 mixin 和混入的区别&#xff…

在Windows中安装极狐GitLab Runner(解决 Host key verification failed.)

官方文档&#xff1a;https://docs.gitlab.cn/runner/install/windows.html 在Windows中安装极狐GitLab Runner 1.下载GitLab Runner二进制文件&#xff0c;新建一个文件夹&#xff08;不要有中文&#xff09;&#xff0c;并将二进制文件放入该文件夹&#xff0c;重命名为“git…

最新成果展示:AlInN/GaN DBR模型数据库的开发与应用

由于AlN和GaN之间存在较大的晶格失配和热膨胀失配&#xff0c;导致很难获得高质量的AlN/GaN布拉格反射镜&#xff08;Distributed Bragg Reflection&#xff0c;DBR&#xff09;结构。为解决该问题&#xff0c;天津赛米卡尔科技有限公司技术团队基于先进的TCAD仿真设计平台开发…

OpenAI Triton 初探

Triton 2021年发布了1.0&#xff0c;我在调研GPU使用方法的时候知道了有这个东西&#xff0c;但是当时还不了解OpenAI&#xff0c;觉得这个项目太新太小众&#xff0c;并没有深究。现在GPT大火之后&#xff0c;再回过头看看他们的这个东西。 现在相关文档还是很少&#xff0c;…

EXCEL数据计算分析功能助力PID闭环控制优化

EXCEL大家并不陌生,这篇博客记录汇总利用EXCEL进行工作分析的一些技巧,专栏也会持续更新,感谢大家关注评论。首先介绍下工控上用的比较多的模拟量采集,模拟量采集的数学基础大家可以查看下面的博客: PLC模拟量输出 模拟量转换FC S_RTI_博图模拟量输出指令_RXXW_Dor的博客…

INDEMIND:陷入创新焦虑的扫地机器人,下一步该怎么走?

卖不动的扫地机器人&#xff0c;需要翻过高价和智能化两座大山。 卖不动的背后&#xff0c;原因是什么&#xff1f; 视角回到行业&#xff0c;随着基站型全功能扫地机器人的出现&#xff0c;机器人的产品力和使用体验得到明显提升&#xff0c;可以说已经能够极大程度的满足消…

Java中查看堆里的信息

文章目录 前言1 建议无脑的做一件事2 jmp命令3 导入 hprof 文件到Visual VM 中4 查看对象属性值 前言 日常工作中&#xff0c;我们可能会遇到这样的场景&#xff1a; java项目发生了OOM&#xff1b;想知道在某种场景下&#xff0c;堆里的信息&#xff0c;从而确认一些代码功能…

2000道面试必问的Java面试八股文及答案整理(2023版)

说快也快&#xff0c;说不快也不慢&#xff01; 年前&#xff0c;陆陆续续&#xff0c;好多大厂都在裁员&#xff1b; 年后&#xff0c;又有一大批程序员失业&#xff0c;找不到避风港&#xff1b; 这时候&#xff0c;就有人说了&#xff0c;为什么找工作这么难&#xff1f;…

【技巧】ZIP文件的分卷压缩如何设置 ?

有时候&#xff0c;因为文件过大&#xff0c;我们进行压缩后发现压缩包依旧很大&#xff0c;不方便储存或邮件发送等。 这种情况就需要把文件进行分卷压缩&#xff0c;也就是根据需要的大小&#xff0c;把文件分别压缩成若干个小压缩包。 还不了解的小伙伴&#xff0c;可以看…

入行这几年,我已经快要摸透了软件测试这一行!

目录 前言&#xff1a; 第一年 第二年 第三年 第四年 作为过来人的一些忠告 自动化测试到底应该学什么&#xff1f; 结尾&#xff1a; 前言&#xff1a; 软件测试是通过对软件系统进行测试、诊断和验证&#xff0c;以保证软件系统能够符合用户需求和预期质量标准的过程。 大…

java设计模式之:适配器模式

文章目录 适配器模式定义通用代码实现适用场景案例场景分析一坨坨代码实现适配器模式重构 总结 适配器模式&#xff08;Adapter Pattern&#xff09;&#xff1a;将一个类的接口变换成客户端所期待的另一种接口&#xff0c;从而使原本因接口不匹配而无法在一起工作的两个类能够…