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, user-scalable=0, maximum-scale=1.0" />
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/index.css">
<title>苏宁易购</title>
<link rel="shortcut icon" href=" favicon.ico" />
</head>
<body>
<!-- 顶部搜索框 -->
<div class="search-content">
<a href="#" class="classify"></a>
<div class="search">
<input type="search" placeholder="厨卫保季暖">
</div>
<div class="login">登录</div>
</div>
<!-- 广告部分 -->
<div class="banner">
<img src="upload/banner.gif" alt="">
</div>
<div class="ad">
<a href="#">
<img src="upload/ad1.gif" alt="">
</a>
<a href="#">
<img src="upload/ad2.gif" alt="">
</a>
<a href="#">
<img src="upload/ad3.gif" alt="">
</a>
</div>
<!-- nav模块 -->
<nav>
<a href="#">
<img src="upload/nav1.png" alt="">
<span>
苏宁秒杀
</span>
</a>
<a href="#">
<img src="upload/nav2.png" alt="">
<span>
苏宁超市
</span>
</a>
<a href="#">
<img src="upload/nav3.png" alt="">
<span>
苏宁拼购
</span>
</a>
<a href="#">
<img src="upload/nav4.png" alt="">
<span>
手机数码
</span>
</a>
<a href="#">
<img src="upload/nav5.png" alt="">
<span>
苏宁家电
</span>
</a>
<a href="#">
<img src="upload/nav6.png" alt="">
<span>
免费水果
</span>
</a>
<a href="#">
<img src="upload/nav7.png" alt="">
<span>
super会员
</span>
</a>
<a href="#">
<img src="upload/nav8.png" alt="">
<span>
签到有礼
</span>
</a>
<a href="#">
<img src="upload/nav9.png" alt="">
<span>
领券中心
</span>
</a>
<a href="#">
<img src="upload/nav10.png" alt="">
<span>
更多频道
</span>
</a>
</nav>
<!-- bottom模块 -->
<div class="bottom">
<div class="row">
<a href="#">
<img src="upload/bot1.jpg" alt="">
</a>
<a href="#">
<img src="upload/bot2.jpg" alt="">
</a>
</div>
<div class="row">
<a href="#">
<img src="upload/bot3.jpg" alt="">
</a>
<a href="#">
<img src="upload/bot4.jpg" alt="">
</a>
</div>
<div class="row">
<a href="#">
<img src="upload/bot5.jpg" alt="">
</a>
</div>
</div>
</body>
</html>
css代码
html {
font-size: 50px;
}
@media screen and (min-width: 320px) {
html {
font-size: 21.33333333px;
}
}
@media screen and (min-width: 360px) {
html {
font-size: 24px;
}
}
@media screen and (min-width: 375px) {
html {
font-size: 25px;
}
}
@media screen and (min-width: 384px) {
html {
font-size: 25.6px;
}
}
@media screen and (min-width: 400px) {
html {
font-size: 26.66666667px;
}
}
@media screen and (min-width: 414px) {
html {
font-size: 27.6px;
}
}
@media screen and (min-width: 424px) {
html {
font-size: 28.26666667px;
}
}
@media screen and (min-width: 480px) {
html {
font-size: 32px;
}
}
@media screen and (min-width: 540px) {
html {
font-size: 36px;
}
}
@media screen and (min-width: 720px) {
html {
font-size: 48px;
}
}
@media screen and (min-width: 750px) {
html {
font-size: 50px;
}
}
img {
vertical-align: middle;
}
a {
text-decoration: none;
}
body {
min-width: 320px;
width: 15rem;
margin: 0 auto;
line-height: 1.5;
font-family: Arial, Helvetica;
background-color: #f2f2f2;
font-size: 25px;
height: 2000px;
}
.search-content {
position: fixed;
display: flex;
left: 0;
top: 0;
left: 50%;
transform: translateX(-50%);
width: 15rem;
height: 1.76rem;
background-color: #ffc001;
align-items: center;
}
.search-content .classify {
width: 0.88rem;
height: 1.4rem;
background: url(../images/classify.png) no-repeat;
background-size: 0.88rem;
margin: 0 0.4rem;
}
.search-content .login {
width: 1.5rem;
height: 1.4rem;
margin: 0 0.2rem;
color: #fff;
font-size: 0.5rem;
text-align: center;
line-height: 1.4rem;
}
.search-content .search {
flex: 1;
}
.search-content .search input {
width: 11.24rem;
height: 1.32rem;
border-radius: 1.32rem;
border: 0;
padding: 0 1rem;
background-color: #fff2cc;
color: #757575;
font-size: 0.52rem;
outline: none;
}
.banner {
width: 15rem;
}
.banner img {
width: 100%;
}
.ad {
display: flex;
width: 15rem;
margin: 0.1rem 0;
}
.ad a {
flex: 1;
}
.ad a img {
width: 100%;
}
nav {
width: 15rem;
overflow: hidden;
background-color: #f6f6f6;
margin-bottom: 0.4rem;
}
nav a {
float: left;
width: 3rem;
height: 2.8rem;
color: #333;
font-size: 0.5rem;
text-align: center;
}
nav a img {
display: block;
width: 1.64rem;
height: 1.64rem;
margin: 0.2rem 0.68rem 0.06rem;
}
.bottom {
width: 15rem;
}
.bottom .row {
display: flex;
}
.bottom .row a {
flex: 1;
box-sizing: border-box;
}
.bottom .row a img {
width: 100%;
}
.bottom .row:nth-child(-n+2) a:nth-child(1) {
border-right: 1px solid #ccc;
}
.bottom .row:nth-child(3) a:nth-child(1) {
border-top: 1px solid #ccc;
}