1.汽车之家顶部
<!DOCTYPE html>
<html lang="en">
<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>
<style>
html,div,body,ul,li{
padding: 0;margin: 0;
font:14px/1;
}
ul{list-style: none}
a{text-decoration: none;}
.top-warp{
display: flex;
justify-content: space-around;
background-color: #256BBF;
color: white;
}
.top-warp .left ,.top-warp .right{
height: 40px;
border: 1px solid black;
/* 设置默认值 是不参与变形的 */
flex: 0 1 70px;
box-sizing: border-box;
}
.top-warp .mid{
flex: 1;
text-align: center;
}
.top-warp .mid input{
width: 90%;
border: 1px solid green;
border-radius: 20px;
height:28px ;
}
.top-nav-warp .top-nav{
display: flex;
justify-content: space-around;
}
.top-nav .nav-item{
/* 参与缩放 */
flex: 1 ;
text-align: center;
background-color: #256BBF;
}
.top-nav .nav-item a{
color: white;
}
.car-list-warp .car-list{
display: flex;
flex-flow: row wrap;
justify-content: space-around;
align-content: space-around;
height: 180px;
border: 1px solid black;
width: 100%;
}
.car-list-warp .car-list .car-item{
flex: 1 0 20%;
/* text-align: center; */
width: 40px;
}
.car-item a{
display: block;
margin: 0 auto;
width: 80%;
text-align: center;
}
.car-item img{
display: block;
width: 50px;
height: 50px;
border-radius: 50%;
background-color: green;
margin: 0 auto;
}
</style>
</head>
<body>
<div class="top-warp">
<div class="left">汽车之家</div>
<div class="mid"> <input type="text" placeholder="输入搜索" > </div>
<div class="right">用户</div>
</div>
<div class="top-nav-warp">
<ul class="top-nav">
<li class="nav-item"><a href="#">链接1</a></li>
<li class="nav-item"><a href="#">链接2</a></li>
<li class="nav-item"><a href="#">链接3</a></li>
<li class="nav-item"><a href="#">链接4</a></li>
<li class="nav-item"><a href="#">链接5</a></li>
</ul>
</div>
<!-- 汽车列表 -->
<div class="car-list-warp">
<ul class="car-list">
<li class="car-item"><a href="#"><img src="" alt="" class="car-img"><span class="car-name">福特1</span></a></li>
<li class="car-item"><a href="#"><img src="" alt="" class="car-img"><span class="car-name">福特2</span></a></li>
<li class="car-item"><a href="#"><img src="" alt="" class="car-img"><span class="car-name">福特3</span></a></li>
<li class="car-item"><a href="#"><img src="" alt="" class="car-img"><span class="car-name">福特4</span></a></li>
<li class="car-item"><a href="#"><img src="" alt="" class="car-img"><span class="car-name">福特5</span></a></li>
<li class="car-item"><a href="#"><img src="" alt="" class="car-img"><span class="car-name">福特6</span></a></li>
<li class="car-item"><a href="#"><img src="" alt="" class="car-img"><span class="car-name">福特7</span></a></li>
<li class="car-item"><a href="#"><img src="" alt="" class="car-img"><span class="car-name">福特8</span></a></li>
<li class="car-item"><a href="#"><img src="" alt="" class="car-img"><span class="car-name">福特9</span></a></li>
<li class="car-item"><a href="#"><img src="" alt="" class="car-img"><span class="car-name">福特10</span></a></li>
</ul>
</div>
</body>
</html>