<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>仿京东首页</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/index.css">
<link rel="stylesheet" href="icon-font/iconfont.css">
</head>
<body>
<div class="header">
<div class="mun iconfont icon-menu"></div>
<div class="srech">
<div class="jd">JD</div>
<div class="fd iconfont icon-search"></div>
<input class="word" type="text" value="美的电压力锅">
</div>
<div class="login">登录</div>
</div>
<div class="main">
<ul class="nav">
<li>
<a href=""><img src="images/dh/nav-1.png" alt=""></a>
<a href="">京东超市</a>
</li>
<li>
<a href=""><img src="images/dh/nav-2.png" alt=""></a>
<a href="">数码电器</a>
</li>
<li>
<a href=""><img src="images/dh/nav-3.png" alt=""></a>
<a href="">京东服饰</a>
</li>
<li>
<a href=""><img src="images/dh/nav-4.png" alt=""></a>
<a href="">京东生鲜</a>
</li>
<li>
<a href=""><img src="images/dh/nav-5.png" alt=""></a>
<a href="">京东到家</a>
</li>
<li>
<a href=""><img src="images/dh/nav-6.png" alt=""></a>
<a href="">充值话费</a>
</li>
<li>
<a href=""><img src="images/dh/nav-7.png" alt=""></a>
<a href="">9.9元拼</a>
</li>
<li>
<a href=""><img src="images/dh/nav-8.png" alt=""></a>
<a href="">领券</a>
</li>
<li>
<a href=""><img src="images/dh/nav-9.png" alt=""></a>
<a href="">借钱</a>
</li>
<li>
<a href=""><img src="images/dh/nav-10.png" alt=""></a>
<a href="">PLUS会员</a>
</li>
</ul>
</div>
<div class="footer">底部</div>
</body>
</html>
/* 初始化 */
*{
margin: 0;
padding: 0;
box-sizing: border-box;
color: #FFF;
}
a{
text-decoration: none;
}
ul,li {
list-style:none;
}
html{
font-size: 10px;
}
/* 头部 */
.header{
display: flex;
position: fixed;
top: 0;
left: 0;
right: 0;
background-color:#E43130;
z-index: 100;
align-items: center;
height: 4.4rem;
}
.header .mun{
flex: 1;
text-align: center;
/* border: 1px solid; */
font-size: 2rem;
}
.header .srech{
flex: 6;
border: 1px solid;
padding: 0.5rem;
border-radius: 3rem;
background-color: #fff;
display: flex;
}
.header .srech .jd{
color: lightcoral;
font-size: 2rem;
flex: 0 1 4rem;
text-align: center;
line-height: 2rem;
}
.header .srech .fd{
color: #cfcbcb;
/* font-size: 2rem; */
border-left: 1px solid;
text-align:center;
line-height: 2rem;
padding: 0 1rem 0 1rem;
}
.header .login{
flex: 1;
font-size: 1.4rem;
/* border: 1px solid; */
text-align: center;
}
.header .srech .word{
flex: auto;
border: none;
outline: none;
color: #cfcbcb;
}
.main{
position: absolute;
top: 4.4rem;
bottom: 4.4rem;
left: 0;
right: 0;
/* background-color: burlywood; */
}
.main .nav a{
color: #000;
}
.main .nav{
display: flex;
flex-flow: row wrap;
justify-content: space-between;
}
.main .nav li{
flex: 1 1 20%;
display: flex;
flex-flow: column nowrap;
/* border: 1px solid red; */
align-items: center;
padding: 1rem;
}
.main .nav img{
width: 4rem;
height: 4rem;
}
.footer{
display: flex;
position: fixed;
bottom: 0;
left: 0;
right: 0;
background-color:#ffffff;
z-index: 100;
box-shadow: 0 0 3px #999;
height: 4.4rem;
}
效果