<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no,
maximum-scale=1.0,minimum-scale=1.0">
<!-- 引入CSS初始化文件-->
<link rel="stylesheet" href="CSS/normalize.css">
<!-- 引入首页CSS-->
<link rel="stylesheet" href="CSS/index.css">
<title>流式布局</title>
</head>
<body>
<header class="app">
<ul>
<li>
<img src="" alt="">
</li>
<li>
<img src="" alt="">
</li>
<li>****,****</li>
<li>####</li>
</ul>
</header>
<div class="search-wrap">
<div class="search-btn">**</div>
<div class="search">
<div class="icon"></div>
<div class="sou"></div>
</div>
<div class="search-login">##</div>
</div>
<div class="slider">
<img src="" alt="">
</div>
<div class="brand">
<div>
<a href="#"><img src="" alt=""></a>
</div>
<div>
<a href="#"><img src="" alt=""></a>
</div>
<div>
<a href="#"><img src="" alt=""></a>
</div>
</div>
<nav>
<a href="#">
<img src="" alt="">
<span>&&&&</span>
</a>
<a href="#">
<img src="" alt="">
<span>&&&&</span>
</a>
<a href="#">
<img src="" alt="">
<span>&&&&</span>
</a>
<a href="#">
<img src="" alt="">
<span>&&&&</span>
</a>
<a href="#">
<img src="" alt="">
<span>&&&&</span>
</a>
<a href="#">
<img src="" alt="">
<span>&&&&</span>
</a>
<a href="#">
<img src="" alt="">
<span>&&&&</span>
</a>
<a href="#">
<img src="" alt="">
<span>&&&&</span>
</a>
<a href="#">
<img src="" alt="">
<span>&&&&</span>
</a>
<a href="#">
<img src="" alt="">
<span>&&&&</span>
</a>
</nav>
<div class="news">
<a href="#">
<img src="#" alt="">
</a>
<a href="#">
<img src="#" alt="">
</a>
<a href="#">
<img src="#" alt="">
</a>
</div>
</body>
</html>
body {
width: 100%;
min-width: 320px;
max-width: 640px;
margin: 0 auto;
font-size: 14px;
font-family: -apple-system, Helvetica, sans-serif;
color: #666;
line-height: 1.5;
background-color: #666666;
}
a {
color: black;
text-decoration: none;
}
ul {
margin: 0;
padding: 0;
list-style: none;
}
img {
vertical-align: top;
}
* {
-webkit-tap-highlight-color: transparent;
}
input {
-webkit-appearance: none;
}
img,
a {
-webkit-touch-callout: none;
}
.app {
height: 45px;
}
.app ul li {
float: left;
height: 45px;
background-color: #333333;
text-align: center;
line-height: 45px;
color: #ffffff;
}
.app ul li:nth-child(1) {
width: 8%;
}
.app ul li:nth-child(1) img {
width: 10px;
}
.app ul li:nth-child(2) {
width: 10%;
background-color: chartreuse;
}
.app ul li:nth-child(2) img {
width: 30px;
vertical-align: middle;
}
.app ul li:nth-child(3) {
width: 57%;
}
.app ul li:nth-child(4) {
width: 25%;
background-color: purple;
}
.search-wrap {
position: fixed;
overflow: hidden;
height: 44px;
min-width: 320px;
max-width: 640px;
width: 100%;
}
.search-btn {
position: absolute;
top: 0;
left: 0;
width: 40px;
height: 44px;
}
.search-btn::before {
content: "";
display: block;
width: 20px;
height: 18px;
/* background: url("") no-repeat;*/
background-size: 20px 18px;
margin: 14px 0 0 15px;
}
.search-login {
position: absolute;
right: 0;
top: 0;
width: 40px;
height: 44px;
color: black;
line-height: 44px;
}
.search {
height: 30px;
background-color: #ffffff;
margin: 0 50px;
border-radius: 15px;
margin-top: 7px;
}
.icon {
width: 20px;
height: 15px;
position: absolute;
top: 8px;
left: 13px;
/* background: url("") no-repeat;*/
background-size: 20px 15px;
}
.icon::after {
content: "";
position: absolute;
right: -8px;
top: 0;
display: block;
width: 1px;
height: 15px;
background-color: #cccccc;
}
/*搜索图标使用精灵图*/
.sou {
position: absolute;
top: 8px;
left: 50px;
width: 18px;
height: 15px;
/*background: url(精灵图) no-repeat -81px 0;*/
background-size: 200px auto;
}
.brand {
overflow: hidden;
border-radius: 10px 10px 0 0;
}
.brand div {
float: left;
width: 33.33px;
}
.brand div img {
width: 100%;
}
nav {
padding-top: 10px;
}
nav a {
float: left;
width: 20%;
text-align: center;
}
nav a img {
width: 40px;
margin: 10px 0;
}
nav a span {
display: block;
}
.news {
margin-top: 20px;
}
.news img {
width: 100%;
}
.news a {
float: left;
box-sizing: border-box;
}
.news a:nth-child(1) {
width: 50%;
}
.news a:nth-child(n+2) {
width: 25%;
border-left: 1px solid #cccccc;
}