0
点赞
收藏
分享

微信扫一扫

移动端携程网

新鲜小饼干 2022-07-18 阅读 72

首先来看效果图

移动端携程网_html

html结构如下

<!DOCTYPE html>
<html lang="en">
<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">
<title>Document</title>
<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"></span>
<span>景点·玩乐</span>
</a>
</li>
<li>
<a href="#" title="周边游">
<span class="local-nav-icon"></span>
<span>周边游</span>
</a>
</li>
<li>
<a href="#" title="美食林">
<span class="local-nav-icon"></span>
<span>美食林</span>
</a>
</li>
<li>
<a href="#" title="一日游">
<span class="local-nav-icon"></span>
<span>一日游</span>
</a>
</li>
<li>
<a href="#" title="当地攻略">
<span class="local-nav-icon"></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"></span>
<span>电话费</span>

</a>
</li>
<li>
<a href="#">
<span class="subnav-entry-icon"></span>
<span>电话费</span>

</a>
</li><li>
<a href="#">
<span class="subnav-entry-icon"></span>
<span>电话费</span>

</a>
</li><li>
<a href="#">
<span class="subnav-entry-icon"></span>
<span>电话费</span>

</a>
</li><li>
<a href="#">
<span class="subnav-entry-icon"></span>
<span>电话费</span>

</a>
</li><li>
<a href="#">
<span class="subnav-entry-icon"></span>
<span>电话费</span>

</a>
</li><li>
<a href="#">
<span class="subnav-entry-icon"></span>
<span>电话费</span>

</a>
</li><li>
<a href="#">
<span class="subnav-entry-icon"></span>
<span>电话费</span>

</a>
</li><li>
<a href="#">
<span class="subnav-entry-icon"></span>
<span>电话费</span>

</a>
</li><li>
<a href="#">
<span class="subnav-entry-icon"></span>
<span>电话费</span>

</a>
</li>
</ul>
<!-- 销售模块 -->
<div class="sales-box">
<div class="sales-hd">
<h4>热门活动</h4>
<a href="#" class="more">获得更多福利</a>
</div>
<div class="sales-bd">
<div class="row">
<a href="#"><img src="upload/pic1.jpg" alt=""></a>
<a href="#"><img src="upload/pic2.jpg" alt=""></a>
</div>
<div class="row">
<a href="#"><img src="upload/pic3.jpg" alt=""></a>
<a href="#"><img src="upload/pic4.jpg" alt=""></a>
</div>
<div class="row">
<a href="#"><img src="upload/pic5.jpg" alt=""></a>
<a href="#"><img src="upload/pic6.jpg" alt=""></a>
</div>
</div>
</div>
<!-- end -->
<ul class="end">
<li>
<a href="#">
<span class="end-icon"></span>
<span>电话预定</span>
</a>
</li>
<li>
<a href="#">
<span class="end-icon"></span>
<span>下载客户端</span>
</a>
</li>
<li>
<a href="#">
<span class="end-icon"></span>
<span>我的</span>
</a>
</li>
</ul>
<!-- 版权 -->
<div class="footer">
网站地图 | 🌏 lauguage∨    | 电脑版<br>
<span>@2018携程旅行 | 沪CP备64343634号</span>
</div>
</body>
</html>

css样式如下

body {
width: 100%;
min-width: 320px;
max-width: 540px;
margin: 0 auto;
font-size: 14px;
font-family: -apple-system, Helvetica, sans-serif;
color: #666;
line-height: 1.5;
background-color: rgb(248, 244, 244);
}
ul {
margin: 0;
padding: 0;
list-style: none;
}
a {
text-align: center;
text-decoration: none;
color: #222;
}
div {
box-sizing: border-box;
}
/* 顶部搜索 */
.search-index{
display: flex;
position: fixed;
top: 0;
left: 50%;
transform: translateX(-50%);
width: 100%;
height: 44px;
min-width: 320px;
max-width: 540px;
background-color: #f6f6f6;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
}
.search{
flex: 1;
height: 26px;
line-height: 24px;
padding-left: 33px;
font-size: 12px;
border: 1px solid #ccc;
margin: 8px 10px;
border-radius: 8px;
box-shadow: 0px 2px 4px rgba(0, 0,0, .2);
}
.search::before {
content: "";
position: absolute;
top: 15px;
left: 20px;
width: 15px;
height: 15px;
background: url(../images/sprite.png) no-repeat -59px -279px;
background-size: 104px auto;
}
.user{
width: 44px;
height: 44px;
font-size: 12px;
margin-top: -4px;
}
.user::before {
content: "";
margin: 5px auto 0;
display: block;
height: 26px;
width: 24px;
background: url(../images/sprite.png) no-repeat -58px -195px;
background-size: 104px auto;
}
/* 焦点图模块 */
.focus img {
width: 100%;
padding-top: 44px;
}
/* 局部导航 */
.local-nav{
display: flex;
height: 64px;
background-color: #fff;
margin: 3px 4px;
border-radius: 8px;
}
.local-nav li {
flex: 1;
}

.local-nav a {
display: flex;
flex-direction: column;
align-items: center;
font-size: 12px;
color: #222;
}
.local-nav-icon {
margin-top: 7px;
width: 32px;
height: 32px;
background: url(../images/localnav_bg.png) no-repeat 0 0;
background-size: 32px auto;
}
.local-nav li:nth-child(2) .local-nav-icon{
background: url(../images/localnav_bg.png) no-repeat 0 -32px;
background-size: 32px auto;
}
.local-nav li:nth-child(3) .local-nav-icon{
background: url(../images/localnav_bg.png) no-repeat 0 -64px;
background-size: 32px auto;
}.local-nav li:nth-child(4) .local-nav-icon{
background: url(../images/localnav_bg.png) no-repeat 0 -96px;
background-size: 32px auto;
}.local-nav li:nth-child(5) .local-nav-icon{
background: url(../images/localnav_bg.png) no-repeat 0 -128px;
background-size: 32px auto;
}
/* 主导航 */
nav{
overflow: hidden;
border-radius: 8px;
margin: 0 4px 3px;
}
.nav-common {
display: flex;
height: 88px;
background-color: pink;
}
.nav-common:nth-child(2) {
margin: 3px 0;
background: -webkit-linear-gradient(left,#4b90eb,#53bced);

}
.nav-common:nth-child(1) {
background: -webkit-linear-gradient(left,#fa5a55,#fa994d);
}
.nav-common:nth-child(3) {
background: -webkit-linear-gradient(left,#34c2a9,#6cd559);
}
.nav-items {
flex:1;
display: flex;
flex-direction: column;
}
.nav-items a {
display: block;
flex: 1;
text-align: center;
line-height: 44px;
color: #fff;
font-size: 14px;
text-shadow: 1px 1px rgba(0, 0,0, .2);
}
.nav-common .nav-items:nth-child(1) a {
border: none;
background: url(../images/hotel.png) no-repeat bottom center;
background-size: 114px auto;
}
.nav-items a:nth-child(1) {
border-bottom: 1px solid #fff;
}
.nav-items:nth-child(-n+2) {
border-right: 1px solid #fff;
}
/* 侧导航 */
.subnav-entry {
display: flex;
flex-wrap: wrap;
border-radius: 8px;
background-color: #fff;
border-radius: 8px;
margin: 0 4px;
padding: 5px 0;
box-shadow: 1px 1px rgba(0, 0,0, .2);
}
.subnav-entry li {
flex: 20%;
}
.subnav-entry a {
display: flex;
flex-direction: column;
align-items: center;
font-size: 12px;
}
.subnav-entry-icon {
width: 28px;
height: 28px;
background-color: pink;
margin-top: 4px;
background: url(../images/subnav-bg.png) no-repeat;
background-size: 28px auto;
}
/* sales-box */
.sales-box {
border-top: 1px solid #bbb;
margin: 4px;
background-color: #fff;
}
.sales-hd {
position: relative;
height: 44px;
background-color: #fff;
border-bottom: 1px solid #ccc;
}
.sales-hd h4 {
text-indent: -999px;
overflow: hidden;
}
.sales-hd h4::after {
position: absolute;
content: "";
background: url(../images/hot.png) no-repeat 0 -20px;
background-size: 79px auto;
width: 79px;
height: 15px;
left: 20px;
top: 7px;
}
.more {
position: absolute;
right: 5px;
top: 0px;
background: -webkit-linear-gradient(left,#ff506c,#ff68c6);
border-radius: 25px;
padding: 3px 20px 3px 10px;
color: #fff;
}
.more::after {
content: "";
position: absolute;
top: 9px;
right: 9px;
width: 7px;
height: 7px;
border-top: 2px solid #fff;
border-right: 2px solid #fff;
transform: rotate(45deg);
}
.row {
display: flex;
border-bottom: 1px solid #eee;
}
.row a {
flex: 1;
}
.row a:nth-child(1) {
border-right: 1px solid #eee;

}
.row a img {
width: 100%;
}
/* end */
.end {
display: flex;
margin: 4px;
background-color: #fff;
}
.end li {
padding: 6px 0;
flex: 1;
}
.end a {
display: flex;
flex-direction: column;
align-items: center;
}
.end-icon {
background: url(../images/sprite.png) no-repeat -58px -152px;
background-size: 104px auto;
width: 20px;
height: 20px;
}
.end li:nth-child(2) .end-icon {
background: url(../images/sprite.png) no-repeat -58px -174px;
background-size: 104px auto;
}
.end li:nth-child(3) .end-icon {
background: url(../images/sprite.png) no-repeat -58px -310px;
background-size: 104px auto;
}
/* footer */
.footer {
text-align: center;
}
.footer span {
color: #ccc;
font-size: 12px;
}

举报

相关推荐

移动端基础

移动端web

vue 移动端

移动端开发

移动端总结?

vue移动端

web移动端

0 条评论