仿京东商城移动端网页
程序员文章站
2022-04-28 22:32:40
...
HTML代码
<!DOCTYPE html>
<html lang="Zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/styles.css">
<title>仿京东商城移动端网页</title>
</head>
<body>
<header>
<div class="tubiao iconfont icon-liebiao2"></div>
<div class="search">
<div class="logo">JD</div>
<div class="search_icon iconfont icon-sousuo"></div>
<input class="search_input" type="text" value="OPPO手机">
</div>
<a href="" class="login">登录</a>
</header>
<main>
<div class="banner">
<div class="banner_bg"></div>
<img src="images/banner.jpg">
</div>
<div class="nav">
<li>
<a href=""><img src="images/1.png" alt=""></a>
<a href="">京东国际</a>
</li>
<li>
<a href=""><img src="images/2.png" alt=""></a>
<a href="">京东拍卖</a>
</li>
<li>
<a href=""><img src="images/3.png" alt=""></a>
<a href="">唯品会</a>
</li>
<li>
<a href=""><img src="images/4.png" alt=""></a>
<a href="">玩3C</a>
</li>
<li>
<a href=""><img src="images/5.png" alt=""></a>
<a href="">沃尔玛</a>
</li>
<li>
<a href=""><img src="images/6.png" alt=""></a>
<a href="">美妆馆</a>
</li>
<li>
<a href=""><img src="images/7.png" alt=""></a>
<a href="">京东旅行</a>
</li>
<li>
<a href=""><img src="images/8.png" alt=""></a>
<a href="">拍拍二手</a>
</li>
<li>
<a href=""><img src="images/9.png" alt=""></a>
<a href="">物流查询</a>
</li>
<li>
<a href=""><img src="images/10.png" alt=""></a>
<a href="">全部</a>
</li>
</div>
<div class="chaoliu">
<h2 class="chaoliu_title">来电好货 国潮风尚</h2>
<div class="chaoliu_sp">
<li>
<a href="">正品直邮</a>
<a href=""><img src="images/chao1.png" alt=""></a>
</li>
<li>
<a href="">3C大放价</a>
<a href=""><img src="images/chao2.png" alt=""></a>
</li>
<li>
<a href="">国货正当时</a>
<a href=""><img src="images/chao3.png" alt=""></a>
</li>
<li>
<a href="">都是你爱的</a>
<a href=""><img src="images/chao4.jpg" alt=""></a>
</li>
</div>
</div>
<h2 class="title">猜你喜欢</h2>
<div class="hot">
<li class="item">
<a href=""><img src="images/1.webp" alt=""></a>
<p>义婕秋冬装2020新款修身网纱针织连衣裙件套毛衣女套装裙A18-6507 黑色 S</p>
<div class="price">
<div class="iconfont icon-rmb">130</div>
<div>看相似</div>
</div>
</li>
<li class="item">
<a href=""><img src="images/2.webp" alt=""></a>
<p>羽绒服女中长款女士外套2020新品秋冬绒加厚 17米白色 L(建议115斤-125斤)</p>
<div class="price">
<div class="iconfont icon-rmb">598 <span>满减</span></div>
<div>看相似</div>
</div>
</li>
<li class="item">
<a href=""><img src="images/3.webp" alt=""></a>
<p>义婕秋冬装2020新款修身网纱针织连衣裙长款假两件套毛衣女套装裙A18-6507 黑色 S</p>
<div class="price">
<div class="iconfont icon-rmb">130 <span>满减</span></div>
<div>看相似</div>
</div>
</li>
<li class="item">
<a href=""><img src="images/4.webp" alt=""></a>
<p>羽绒服女中长款女士外套2020新品秋冬季亮面冬装派克服新款 17米白色 L(</p>
<div class="price">
<div class="iconfont icon-rmb">598</div>
<div>看相似</div>
</div>
</li>
<li class="item">
<a href=""><img src="images/5.webp" alt=""></a>
<p>义婕秋冬装2020新款修身网纱针织连衣裙长款假两件套毛衣女套装裙A18-6507 黑色 S</p>
<div class="price">
<div class="iconfont icon-rmb">130 <span>满减</span></div>
<div>看相似</div>
</div>
</li>
<li class="item">
<a href=""><img src="images/6.webp" alt=""></a>
<p>羽绒服女中长款女士外套2020新品秋冬季真毛领白鸭绒加厚装派克服新款 17米白色</p>
<div class="price">
<div class="iconfont icon-rmb">598</div>
<div>看相似</div>
</div>
</li>
<li class="item">
<a href=""><img src="images/7.webp" alt=""></a>
<p>义婕秋冬装2020新款修身网纱针织连衣裙长款假两件套毛衣女套装裙A18-6507 黑色 S</p>
<div class="price">
<div class="iconfont icon-rmb">130</div>
<div>看相似</div>
</div>
</li>
<li class="item">
<a href=""><img src="images/8.webp" alt=""></a>
<p>羽绒服女服大码亮面冬装派克服新款 17米白色 L(建议115斤-125斤)</p>
<div class="price">
<div class="iconfont icon-rmb">598 <span>满减</span></div>
<div>看相似</div>
</div>
</li>
</div>
</main>
<footer>
<div>
<div class="iconfont icon-home2"></div>
<span>主页</span>
</div>
<div>
<div class="iconfont icon-liebiao"></div>
<span>分类</span>
</div>
<div>
<div class="iconfont icon-31huiyuan"></div>
<span>京喜</span>
</div>
<div>
<div class="iconfont icon-cart"></div>
<span>购物车</span>
</div>
<div>
<div class="iconfont icon-31wodexuanzhong"></div>
<span>未登录</span>
</div>
</footer>
</body>
</html>
CSS代码
@import '../iconfont/iconfont.css';
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
li {
list-style: none;
}
a {
color: #7b7b7b;
text-decoration: none;
}
body {
background-color: #F6F6F6;
}
html {
font-size: 10px;
}
@media screen and (min-width: 480px) {
html {
font-size: 12px;
}
}
@media screen and (min-width: 640px) {
html {
font-size: 14px;
}
}
@media screen and (min-width: 720px) {
html {
font-size: 16px;
}
}
@media screen and (min-width: 960px) {
html {
font-size: 18px;
}
}
@media screen and (min-width: 1024px) {
html {
font-size: 20px;
}
}
header {
background-color: #C82519;
height: 4.5rem;
position: fixed;
left: 0;
right: 0;
display: flex;
justify-content: space-between;
align-items: center;
z-index: 100;
}
header .tubiao {
flex: 0 1 5rem;
color: white;
font-size: 2.2rem;
text-align: center;
}
header .search {
flex: 10;
color: white;
display: flex;
text-align: center;
background-color: white;
border-radius: 3rem;
padding: 0.3rem;
align-items: center;
}
header .search .logo {
flex: 0 1 4rem;
color: #E93B3D;
font-size: 1.4rem;
}
header .search .search_icon {
flex: 0 1 3rem;
color: #666;
font-size: 1.25rem;
border-left: 1px solid #eee;
}
header .search .search_input {
flex: auto;
border: none;
outline: none;
color: #aaa;
}
header .login {
flex: 0 1 5rem;
color: white;
font-size: 1.4rem;
text-align: center;
}
footer {
box-shadow: 10px 10px 15px #888888;
background-color: #fff;
height: 6rem;
position: fixed;
bottom: 0;
left: 0;
right: 0;
color: #8B8B8B;
}
footer {
display: flex;
justify-content: space-around;
align-items: center;
}
footer>div {
display: flex;
flex-flow: column nowrap;
align-items: center;
}
footer>div>.iconfont {
font-size: 2rem;
}
footer>div>span {
font-size: 1rem;
}
main {
min-height: 120vh;
padding: 4.5rem 0;
}
main .banner {
display: flex;
flex-flow: column nowrap;
}
main .banner .banner_bg {
background-color: #C82519;
border-radius: 0 0rem 2rem 2em;
height: 10rem;
position: relative;
}
main .banner img {
width: 90%;
position: absolute;
top: 5rem;
left: 2rem;
right: 2rem;
margin: auto;
border-radius: 1rem;
}
main .nav {
margin-top: 8rem;
display: flex;
flex-wrap: wrap;
}
main .nav li {
width: 20%;
display: flex;
flex-flow: column nowrap;
align-items: center;
font-size: 1.3rem;
}
main .nav li img {
width: 5rem;
}
main .chaoliu {
height: 12rem;
background-color: white;
margin: 2rem 0;
}
main .chaoliu .chaoliu_title {
text-align: center;
font-size: 1.8rem;
padding: 0.5rem 0;
}
main .chaoliu .chaoliu_sp {
display: flex;
justify-content: center;
}
main .chaoliu .chaoliu_sp li {
display: flex;
flex-flow: column wrap;
align-items: center;
width: 25vw;
font-size: 1.2rem;
font-weight: 650;
color: #000000;
}
main .chaoliu .chaoliu_sp li img {
width: 6rem;
}
.title {
height: 4rem;
color: #555;
font-weight: 500;
text-align: center;
line-height: 4rem;
margin: 1rem 0;
background-color: #e7e7e7;
}
main .hot {
font-size: 1rem;
display: flex;
flex-wrap: wrap;
margin-bottom: 1.5rem;
}
main .hot .item {
flex: 1 1 calc(50% - 2rem);
background-color: #fff;
overflow: hidden;
display: flex;
flex-flow: column nowrap;
margin-left: 1rem;
margin-bottom: 1rem;
padding-bottom: 1rem;
border-radius: 1rem;
}
main .hot .item p {
font-size: 1.2rem;
color: #555;
}
main .hot .item img {
width: 100%;
height: 100%;
}
main .hot .item {
padding: 1rem;
}
main .hot .item .price {
display: flex;
justify-content: space-between;
}
main .hot .item .price div:first-of-type {
color: red;
}
main .hot .item .price div:first-of-type span {
border: 1px solid red;
border-radius: 0.5rem;
padding: 0.2rem;
font-size: 1.1rem;
}
main .hot .item .price div:last-of-type {
color: #666;
background-color: #f6f6f6;
border-radius: 1rem;
padding: 0.7rem 1rem;
}
下一篇: ps怎么调渐变色背景