<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
*{
padding: 0;
margin: 0;
}
header{
width: 100%;
display: flex;
}
header>a{
flex: 1;
}
header>a>img{
width: 100%;
}
main
{
width: 100%;
padding: 0 10px;
box-sizing: border-box;
}
main>.item{
border-radius: 10px;
width: 100%;
height: 100px;
background-color: #4afbef;
margin-top: 10px;
display: flex;
}
main>.item:nth-of-type(2)
{
background-color: pink;
}
main>.item:nth-of-type(3)
{
background-color: #fff4b0;
}
main>.item:nth-of-type(4)
{
background-color: #77b2ff;
}
main > .item > .left{
flex: 1;
}
main > .item > .right{
flex: 2;
/*设置换行显示*/
flex-wrap: wrap;
/*设置为伸缩盒子*/
display: flex;
}
main> .item> .right>a
{
width: 50%;
box-sizing: border-box;
border-left: 1px solid #fff;
border-bottom: 1px solid #fff;
display:block;
color: #040404;
line-height: 50px;
text-align: center;
text-decoration: none;
}
main > .item>.right>a:nth-last-of-type(-n+2)
{border-bottom: none;}
main>.extra{
width: 100%;
display: flex;
}
main>.extra>a{
flex: 1;
}
main > .extra > a > img{
width: 100%;
}
footer{
width: 100%;
font-size: 13px;
}
footer>nav{
width: 100%;
display: flex;
}
footer>nav>a{
flex: 1;
text-decoration: none;
color: black;
text-align: center;
line-height: 35px;
border-top: 1px solid #cccccc;
border-bottom: 1px solid #cccccc;
}
footer>p
{
text-align: center;
line-height: 25px;
}
</style>
</head>
<body>
<div class="container">
<header>
<a href="">
<img src="../4-代码/images/banner.jpg" alt="">
</a>
</header>
<main>
<section class="item">
<div class="left"></div>
<div class="right">
<a href="">海外酒店</a>
<a href="">团购</a>
<a href="">特惠酒店</a>
<a href="">客栈公寓</a>
</div>
</section>
<section class="item">
<div class="left"></div>
<div class="right">
<a href="">海外酒店</a>
<a href="">团购</a>
<a href="">特惠酒店</a>
<a href="">客栈公寓</a>
</div>
</section>
<section class="item">
<div class="left"></div>
<div class="right">
<a href="">海外酒店</a>
<a href="">团购</a>
<a href="">特惠酒店</a>
<a href="">客栈公寓</a>
</div>
</section>
<section class="item">
<div class="left"></div>
<div class="right">
<a href="">海外酒店</a>
<a href="">团购</a>
<a href="">特惠酒店</a>
<a href="">客栈公寓</a>
</div>
</section>
<section class="extra">
<a href="">
<img src="../4-代码/images/extra_1.png" alt="">
</a>
<a href="">
<img src="../4-代码/images/extra_2.png" alt="">
</a>
</section>
</main>
<footer>
<nav>
<a href="">电话预订</a>
<a href="">下载客户端</a>
<a href="">我的订单</a>
</nav>
<p class="link">
<a href="">网站地图</a>
<a href="">ENGLISH</a>
<a href="">电脑版</a>
</p>
<p class="copyRight">©2015 携程旅行</p>
</footer>
</div>
</body>
</html>
H5简短图片角标布局
最新推荐文章于 2022-11-13 00:34:41 发布