一、项目展示
根据2023年6月京东商城移动端(多快好省,购物逛京东! (jd.com)),主要采用HTML、CSS和少量JS进行设计,依旧是大量使用盒子模型div和css,布局采用flex,其中轮播图部分使用了js,同时为了避免css耗费时间过多,有一部分使用了less进行设计。
此次项目主要设计了四个页面,分别是主页、商品详细页面、购物车页面和登录页面。项目展示效果如下:
1、主页
商品浏览部分很多,就不一一截图了,只截取了主要部分。
2、商品详细页面
商品的详细页面只设计了第一个商品,其他商品只需要根据这个页面进行复制然后更改文字和图片即可。详细的图片部分就不一一截取,只截取关键部分。
3、购物车页面
4、登录页面
二、项目代码
1、主页
HTML:
<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">
<title>京东商城</title>
<link rel="stylesheet" href="./index.css">
<link rel="stylesheet" href="./all.css">
<link rel="stylesheet" href="./swiper-bundle.min.css">
<script src="./swiper-bundle.min.js"></script>
<script src="./index.js"></script>
</head>
<body>
<!-- FLEX布局 -->
<!-- 头部 -->
<div id="header">
<div></div>
<div>
<img src="./img/京东.png" alt="">
<img src="./img/搜索.png" alt="">
</div>
<div><a href="./登录页.html">登录</a></div>
</div>
<!-- 空div -->
<div class="kong"></div>
<!-- 轮播图部分 -->
<div id="banner">
<div class="swiper bannerSwiper">
<div class="swiper-wrapper">
<div class="swiper-slide">
<a href="#">
<img src="./img/轮播图1.jpg" alt="">
</a>
</div>
<div class="swiper-slide">
<a href="#">
<img src="./img/轮播图2.jpg" alt="">
</a>
</div>
<div class="swiper-slide">
<a href="#">
<img src="./img/轮播图3.jpg" alt="">
</a>
</div>
<div class="swiper-slide">
<a href="#">
<img src="./img/轮播图4.jpg" alt="">
</a>
</div>
<div class="swiper-slide">
<a href="#">
<img src="./img/轮播图5.jpg" alt="">
</a>
</div>
<div class="swiper-slide">
<a href="#">
<img src="./img/轮播图6.jpg" alt="">
</a>
</div>
<div class="swiper-slide">
<a href="#">
<img src="./img/轮播图7.jpg" alt="">
</a>
</div>
<div class="swiper-slide">
<a href="#">
<img src="./img/轮播图8.jpg" alt="">
</a>
</div>
</div>
<div class="swiper-pagination"></div>
</div>
</div>
<!-- 导航部分 -->
<div id="nav">
<div class="swiper navSwiper">
<div class="swiper-wrapper">
<div class="swiper-slide">
<a href="#">
<img src="./img/超市.png" alt="超市">
<span>京东超市</span>
</a>
<a href="#">
<img src="./img/电器.png" alt="数码电器">
<span>数码电器</span>
</a>
<a href="#">
<img src="./img/新百货.png" alt="京东新百货">
<span>京东新百货</span>
</a>
<a href="#">
<img src="./img/生鲜.png" alt="京东生鲜">
<span>京东生鲜</span>
</a>
<a href="#">
<img src="./img/到家.png" alt="京东到家">
<span>京东到家</span>
</a>
<a href="#">
<img src="./img/缴费.png" alt="充值缴费">
<span>充值缴费</span>
</a>
<a href="#">
<img src="./img/好店.png" alt="附近好店">
<span>附近好店</span>
</a>
<a href="#">
<img src="./img/会员.png" alt="PLUS会员">
<span>PLUS会员</span>
</a>
<a href="#">
<img src="./img/国际.png" alt="京东国际">
<span>京东国际</span>
</a>
<a href="#">
<img src="./img/拍卖.png" alt="京东拍卖">
<span>京东拍卖</span>
</a>
</div>
<div class="swiper-slide">
<a href="#">
<img src="./img/玩3C.png" alt="玩3C">
<span>玩3C</span>
</a>
<a href="#">
<img src="./img/沃尔玛.png" alt="沃尔玛">
<span>沃尔玛</span>
</a>
<a href="#">
<img src="./img/美妆馆.png" alt="美妆馆">
<span>美妆馆</span>
</a>
<a href="#">
<img src="./img/京东旅行.png" alt="京东旅行">
<span>京东旅行</span>
</a>
<a href="#">
<img src="./img/拍拍二手.png" alt="拍拍二手">
<span>拍拍二手</span>
</a>
<a href="#">
<img src="./img/智能.png" alt="京东智能">
<span>京东智能</span>
</a>
<a href="#">
<img src="./img/运动户外.png" alt="运动户外">
<span>运动户外</span>
</a>
<a href="#">
<img src="./img/汽车用品.png" alt="汽车用品">
<span>汽车用品</span>
</a>
<a href="#">
<img src="./img/山姆店.png" alt="山姆店">
<span>山姆店</span>
</a>
<a href="#">
<img src="./img/全.png" alt="全部">
<span>全部</span>
</a>
</div>
</div>
<div class="swiper-pagination"></div>
</div>
</div>
<!-- 秒杀部分 -->
<div id="miaosha">
<div class="m-top">
<div class="m-top-word">
<a href="#">京东秒杀</a>
</div>
<div class="m-top-date">
<a href="#">20</a>
</div>
<div class="m-top-time">
<a href="#">
<span class="time">00</span>
<span class="time">48</span>
<span class="time">09</span>
</a>
</div>
<div class="m-top-more">
<a href="#">
<span><img src="./img/向右3-fill.png" alt=""></span>
</a>
</div>
</div>
<div class="m-bottom">
<div class="swiper bottomSwiper">
<div class="swiper-wrapper">
<div class="swiper-slide">
<a href="#">
<img src="./img/秒杀1.jpg" alt="">
<span>¥29.9</span>
</a>
</div>
<div class="swiper-slide">
<a href="#">
<img src="./img/秒杀2.jpg" alt="">
<span>¥33.8</span>
</a>
</div>
<div class="swiper-slide">
<a href="#">
<img src="./img/秒杀3.jpg" alt="">
<span>¥9.3</span>
</a>
</div>
<div class="swiper-slide">
<a href="#">
<img src="./img/秒杀4.jpg" alt="">
<span>¥988</span>
</a>
</div>
<div class="swiper-slide">
<a href="#">
<img src="./img/秒杀5.jpg" alt="">
<span>¥96</span>
</a>
</div>
<div class="swiper-slide">
<a href="#">
<img src="./img/秒杀6.jpg" alt="">
<span>¥32</span>
</a>
</div>
<div class="swiper-slide">
<a href="#">
<img src="./img/秒杀7.jpg" alt="">
<span>¥31.9</span>
</a>
</div>
<div class="swiper-slide">
<a href="#">
<img src="./img/秒杀8.jpg" alt="">
<span>¥74.9</span>
</a>
</div>
<div class="swiper-slide">
<a href="#">
<img src="./img/秒杀9.jpg" alt="">
<span>¥569</span>
</a>
</div>
</div>
<div class="swiper-pagination"></div>
</div>
</div>
</div>
<!-- 底部 -->
<div id="footer">
<a href="index.html">
<img src="./img/首页.png" alt="">
</a>
<a href="#">
<img src="./img/分类.png" alt="">
</a>
<a href="./购物车.html">
<img src="./img/购物车.png" alt="">
</a>
<a href="./登录页.html">
<img src="./img/未登录.png" alt="">
</a>
</div>
<!-- 商品推荐 -->
<div id="goods">
<div class="g-stamp"><a href="./商品.html">
<img src="./img/商品1.jpg" alt="">
<span class="title">易开得厨下净热一体机</span>
<div class="pricemin">15天最低价</div>
<p class="price"><span>¥</span><span class="old-p">4580</span>.00</p>
<div class="pinglun">100+条评论<div class="similar">看相似</div></div>
</a></div>
<div class="g-stamp"><a href="#">
<img src="./img/商品2.jpg" alt="">
<span class="title">小米净水器家用净水机滤芯PP棉 自来水过滤 建议3-6月更换 适用600G厨下式/400G厨上增强版/400G厨下</span>
<p class="price"><span>¥</span><span class="old-p">59</span>.00</p>
<div class="pinglun"><img src="./img/自营.png" alt=""><div class="similar">看相似</div></div>
</a></div>
<div class="g-stamp"><a href="#">
<img src="./img/商品3.jpg" alt="">
<span class="title">碧云泉(bewinch) G7弱碱性智能反渗透净水器</span>
<p class="price"><span>¥</span><span class="old-p">5499</span>.00</p>
<div class="pinglun">1万+条评论<div class="similar">看相似</div></div>
</a></div>
<div class="g-stamp"><a href="#">
<img src="./img/商品4.jpg" alt="">
<span class="title">小米 米家空调伴侣2 远程控制 小爱声控 睡后调温 电量统计</span>
<p class="price"><span>¥</span><span class="old-p">79</span>.00</p>
<div class="pinglun">20万+条评论<div class="similar">看相似</div></div>
</a></div>
<div class="g-stamp"><a href="#">
<img src="./img/商品5.jpg" alt="">
<span class="title">德捷睿【净水壶滤芯】适配过滤壶滤芯过滤净水壶适用于家用净水器滤芯三代12支装 4支【专家版】去水垢能力提升50%</span>
<div class="pricemin">90天最低价</div>
<p class="price"><span>¥</span><span class="old-p">98</span>.00</p>
<div class="pinglun">2000+条评论<div class="similar">看相似</div></div>
</a></div>
<div class="g-stamp"><a href="#">
<img src="./img/商品6.jpg" alt="">
<span class="title">德捷睿净水壶家用净水器厨房过滤器通用德国Brita滤水壶多效过滤去除水垢 6支滤芯专家版加强去垢</span>
<p class="price"><span>¥</span><span class="old-p">139</span>.00</p>
<div class="pinglun"><img src="./img/自营.png" alt=""><div>500+条评论</div>
<div class="similar">看相似</div></div>
</a></div>
<div class="g-stamp"><a href="#">
<img src="./img/商品10.jpg" alt="">
<span class="title">固特威汽车挡风玻璃油膜去除剂油膜清洁乳清洁膏油膜清洁剂可定制</span>
<p class="price"><span>¥</span><span class="old-p">39</span>.90</p>
<div class="pinglun"><img src="./img/自营.png" alt=""><div>60万+条评论</div>
<div class="similar">看相似</div></div>
</a></div>
<div class="g-stamp"><a href="#">
<img src="./img/商品8.jpg" alt="">
<span class="title">skg颈椎按摩器 K5系列2代尊贵款 颈部按摩仪脖子肩颈护颈仪热敷电脉冲 送爸爸父亲节礼品礼物礼盒款</span>
<p class="price"><span>¥</span><span class="old-p">649</span>.00</p>
<div class="pinglun"><img src="./img/自营.png" alt=""><div>50万+条评论</div>
<div class="similar">看相似</div></div>
</a></div>
<div class="g-stamp"><a href="#">
<img src="./img/商品9.jpg" alt="">
<span class="title">冰希黎(Boitown)女士香水幻彩鎏金香水女香水礼盒送女友送老婆礼物</span>
<p class="price"><span>¥</span><span class="old-p">198</span>.00</p>
<div class="pinglun">20万+条评论<div class="similar">看相似</div></div>
</a></div>
<div class="g-stamp"><a href="#">
<img src="./img/商品7.jpg" alt="">
<span class="title">米家 小米空气净化器滤芯滤网 标准版 家用除甲醛除菌除二手烟异味 净化器2/2S/3/pro通用</span>
<p class="price"><span>¥</span><span class="old-p">149</span>.00</p>
<div class="pinglun"><img src="./img/自营.png" alt=""><div class="similar">看相似</div></div>
</a></div>
<div class="g-stamp"><a href="#">
<img src="./img/商品11.jpg" alt="">
<span class="title">荣耀magic4 新品5G手机 全网通 瓷青 8GB+256GB</span>
<div class="pricemin">90天最低价</div>
<p class="price"><span>¥</span><span class="old-p">3298</span>.00</p>
<div class="pinglun">2000+条评论<div class="similar">看相似</div></div>
</a></div>
<div class="g-stamp"><a href="#">
<img src="./img/商品12.jpg" alt="">
<span class="title">M.A.C魅可mac黑魔杖细管口红唇膏05#893甜肉桂 生日礼物女</span>
<p class="price"><span>¥</span><span class="old-p">230</span>.00</p>
<div class="pinglun"><img src="./img/自营.png" alt=""><div>5万+条评论</div>
<div class="similar">看相似</div></div>
</a></div>
<div class="g-stamp"><a href="#">
<img src="./img/商品13.jpg" alt="">
<span class="title">3M净水器滤芯家用直饮机厨房过滤器滤芯保留矿物质DWS1893-CN滤芯 DWS1883M-CN滤芯</span>
<div class="pricemin">30天最低价</div>
<p class="price"><span>¥</span><span class="old-p">879</span>.00</p>
<div class="pinglun">5000+条评论<div class="similar">看相似</div></div>
</a></div>
<div class="g-stamp"><a href="#">
<img src="./img/商品14.jpg" alt="">
<span class="title">神火(supfire)RX21强光手电筒变焦远射超亮Type-C充电多功能家用便携 户外骑行停电照明应急灯</span>
<p class="price"><span>¥</span><span class="old-p">69</span>.00</p>
<div class="pinglun"><img src="./img/自营.png" alt=""><div>5万+条评论</div>
<div class="similar">看相似</div></div>
</a></div>
<div class="g-stamp"><a href="#">
<img src="./img/商品15.jpg" alt="">
<span class="title">倍世(BWT)家用过滤水壶净水壶镁离子全屋净水滤芯过滤杯厨房净水器2.7L容量 白色1壶8芯(2镁离子+6去水垢) BWT 净水壶套装</span>
<p class="price"><span>¥</span><span class="old-p">429</span>.00</p>
<div class="pinglun">100+条评论<div class="similar">看相似</div></div>
</a></div>
<div class="g-stamp"><a href="#">
<img src="./img/商品16.jpg" alt="">
<span class="title">百草味活力鲜鲜款750g30袋 每日坚果礼盒零食大礼包干果送女友端午送礼</span>
<p class="price"><span>¥</span><span class="old-p">74</span>.00</p>
<div class="pinglun"><img src="./img/自营.png" alt=""><div class="similar">看相似</div></div>
</a></div>
</div>
<!-- 页面底部 -->
<div id="bottom">
<div class="box-1">
<div class="text"><a href="#">登录</a></div><div class="aaa">|</div>
<div class="text"><a href="#">注册</a></div><div class="aaa">|</div>
<div class="text"><a href="#">客户服务</a></div><div class="aaa">|</div>
<div class="text"><a href="./index.html">返回顶部</a></div>
</div>
<div class="box-2">
<div><img src="./img/客户端.png" alt=""></div>
<div><img src="./img/国际版.png" alt=""></div>
<div><img src="./img/电脑版.png" alt=""></div>
</div>
<div class="box-3">Copyright © 2004-2020 京东JD.com 版权所有</div>
<div class="box-4"></div>
</div>
<!-- 右下角导航 -->
<div id="daohang">
<a href="./index.html"><img src="./img/返回.png" alt=""></a>
</div>
</body>
CSS:
#header {
width: 100%;
height: 44px;
background-color: #c82519;
display: flex;
/* 固定定位 */
position: fixed;
top: 0;
padding: 0;
z-index: 10;
}
#header div:first-child {
width: 12%;
height: 100%;
float: left;
background-image: url(img/导航.png);
background-size: 28px;
background-position: center;
background-repeat: no-repeat;
}
#header > div:nth-child(2) {
width: 76%;
height: 69%;
background-color: white;
float: left;
margin-top: 5px;
border-radius: 15px;
line-height: 42px;
}
#header > div:nth-child(2) > img:first-child {
height: 20px;
border-right: 1px solid lightgray;
padding-right: 8px;
margin-left: 18px;
}
#header > div:nth-child(2) > img:last-child {
height: 20px;
padding-left: 5px;
}
#header div:last-child {
width: 12%;
height: 100%;
justify-content: flex-end;
text-align: center;
line-height: 44px;
}
#header div:last-child a {
font-size: 16px;
color: #fff;
}
.kong {
height: 42px;
}
#banner {
width: 100%;
height: 145px;
border-bottom-left-radius: 100%;
border-bottom-right-radius: 100%;
background-image: linear-gradient(0deg, #c82519, #c82519 50%);
display: flex;
text-align: center;
}
#banner .swiper-pagination-bullet-active,
#banner .swiper-pagination-bullet {
width: 5px;
height: 5px;
border-radius: 5px;
background-color: #ccc;
opacity: 1;
}
#banner .swiper-pagination-bullet-active {
background-color: #c82519;
}
#banner img {
width: 93%;
height: 96%;
border-radius: 10px;
margin-top: 7px;
}
#nav {
position: relative;
}
#nav .swiper-slide {
width: 100%;
height: 175px;
display: flex;
flex-wrap: wrap;
margin-top: 10px;
}
#nav .swiper-slide a {
width: 20%;
height: 70px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
flex-wrap: wrap;
}
#nav .swiper-slide a img {
width: 40px;
}
#nav .swiper-slide a span {
margin-top: 10px;
color: #666666;
font-size: 12px;
}
#nav .swiper-pagination {
position: absolute;
left: 0;
right: 0;
text-align: center;
bottom: 0;
z-index: 10;
}
#nav .swiper-pagination .swiper-pagination-bullet-active,
#nav .swiper-pagination .swiper-pagination-bullet {
width: 5px;
height: 5px;
border-radius: 5px;
background-color: #ccc;
opacity: 1;
}
#nav .swiper-pagination .swiper-pagination-bullet-active {
background-color: #c82519;
}
#miaosha {
width: 100%;
height: 140px;
background-color: #fff;
margin-top: 10px;
border-radius: 15px;
}
#miaosha .m-top {
display: flex;
}
#miaosha .m-top .m-top-word {
width: 70px;
height: 34px;
text-align: center;
line-height: 34px;
font-size: 14px;
justify-content: flex-start;
}
#miaosha .m-top .m-top-word a {
color: black;
}
#miaosha .m-top .m-top-date {
width: 25px;
height: 34px;
text-align: center;
line-height: 34px;
flex: 1;
}
#miaosha .m-top .m-top-date a {
color: #fc3a29;
}
#miaosha .m-top .m-top-date::after {
width: 25px;
height: 17px;
content: '';
background-image: url(img/点场.png);
background-position: 50%;
background-size: contain;
background-repeat: no-repeat;
display: inline-block;
}
#miaosha .m-top .m-top-time {
height: 34px;
line-height: 34px;
flex: 5;
}
#miaosha .m-top .m-top-time .time {
width: 15px;
height: 18px;
background-color: #fc3a29;
border-radius: 3px;
color: #fff;
font-size: 14px;
}
#miaosha .m-top .m-top-more {
width: 23px;
line-height: 35px;
}
#miaosha .m-top .m-top-more img {
width: 12px;
height: 12px;
}
#miaosha .m-bottom .swiper-slide {
width: 375px;
height: 100px;
display: flex;
background-color: #fff;
margin-left: 10px;
}
#miaosha .m-bottom .swiper-slide a {
width: 16.66%;
height: 100px;
flex-direction: column;
justify-content: center;
align-items: center;
flex-wrap: wrap;
}
#miaosha .m-bottom .swiper-slide a img {
width: 55px;
margin-left: -13px;
margin-top: 10px;
}
#miaosha .m-bottom .swiper-slide a span {
color: #fc3a29;
font-size: 14px;
font-weight: 600;
}
#footer {
width: 100%;
height: 42px;
background-color: #fff;
box-shadow: 0 0 10px 0 hsla(0, 6%, 58%, 0.6);
position: fixed;
bottom: 0;
display: flex;
z-index: 10;
}
#footer a {
width: 25%;
justify-content: space-around;
display: flex;
}
#footer a img {
align-items: center;
width: 55px;
}
#goods {
width: 100%;
margin-top: 20px;
display: flex;
/* 换行 */
flex-wrap: wrap;
justify-content: space-evenly;
box-sizing: border-box;
}
#goods .g-stamp {
width: 48%;
min-height: 250px;
box-sizing: border-box;
background: #fff;
margin-bottom: 15px;
border-radius: 15px;
margin-left: 3px;
margin-right: 3px;
}
#goods .g-stamp > a > img {
width: 100%;
border-radius: 10px 10px 0px 0px;
}
#goods .g-stamp .title {
width: 90%;
min-height: 30px;
font-size: 14px;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
margin-top: 5px;
color: #434343;
margin-left: 10px;
}
#goods .g-stamp .pricemin {
display: inline-block;
margin-top: 2px;
font-size: 12px;
color: #ff3090;
background-color: #fff7ef;
margin-left: 10px;
}
#goods .g-stamp .price {
margin-top: 6px;
font-size: 14px;
color: #ff4142;
margin-left: 10px;
}
#goods .g-stamp .price .old-p {
font-size: 20px;
}
#goods .g-stamp .pinglun {
color: #999;
font-size: 12px;
margin-left: 10px;
position: relative;
margin-top: -1px;
margin-bottom: 12px;
}
#goods .g-stamp .pinglun img {
align-items: center;
width: 24px;
margin-top: 8px;
}
#goods .g-stamp .pinglun .similar {
display: inline-block;
background-color: #f2f2f2;
color: #000;
font-size: 12px;
margin-top: 5px;
margin-bottom: 8px;
border-radius: 8px;
padding-right: 8px;
padding-left: 8px;
text-align: right;
position: absolute;
right: 10px;
bottom: -9px;
}
#bottom {
width: 100%;
height: 200px;
background-color: #fff;
text-align: center;
}
#bottom .box-1 {
width: 100%;
height: 58px;
display: flex;
border-top: 1px solid #ebebeb;
border-bottom: 1px solid #ebebeb;
}
#bottom .box-1 .text {
flex: 1;
margin-top: 20px;
}
#bottom .box-1 .text a {
color: #848689;
font-size: 14px;
}
#bottom .box-1 .aaa {
color: #ebebeb;
margin-top: 20px;
}
#bottom .box-2 {
width: 100%;
height: 68.7px;
display: flex;
border-bottom: 1px solid #ebebeb;
}
#bottom .box-2 div {
flex: 1;
margin-top: 5px;
}
#bottom .box-2 div img {
width: 60px;
}
#bottom .box-3 {
width: 100%;
height: 33px;
color: #848689;
font-size: 12px;
margin-top: 6px;
}
#bottom .box-4 {
height: 42px;
}
#daohang {
position: fixed;
bottom: 110px;
right: 6px;
z-index: 11;
}
#daohang img {
width: 38px;
height: 38px;
}
LESS:
// 头部
#header {
width: 100%;
height: 44px;
background-color: rgb(200,37,25);
display: flex;
/* 固定定位 */
position: fixed;
top: 0;
padding: 0;
z-index: 10;
div:first-child{
width: 12%;
height: 100%;
float: left;
background-image: url(./img/导航.png);
background-size: 28px;
background-position: center;
background-repeat: no-repeat;
}
>div:nth-child(2) {
width: 76%;
height: 69%;
background-color: white;
float: left;
margin-top: 5px;
border-radius: 15px;
line-height: 42px;
>img:first-child{
height: 20px;
border-right: 1px solid lightgray;
padding-right: 8px;
margin-left: 18px;
}
>img:last-child{
height: 20px;
padding-left: 5px;
}
}
div:last-child{
width: 12%;
height: 100%;
justify-content: flex-end;
text-align: center;
line-height: 44px;
a{
font-size: 16px;
color: #fff;
}
}
}
// 空div
.kong{
height: 42px;
}
// 轮播图
#banner{
width: 100%;
height: 145px;
border-bottom-left-radius: 100%;
border-bottom-right-radius: 100%;
background-image: linear-gradient(0deg,rgb(200,37,25),rgb(200,37,25) 50%);
display: flex;
text-align:center;
.swiper-pagination-bullet-active,.swiper-pagination-bullet{
width: 5px;
height: 5px;
border-radius: 5px;
background-color: #ccc;
opacity: 1;
}
.swiper-pagination-bullet-active{
background-color: rgb(200,37,25);
}
img{
width: 93%;
height: 96%;
border-radius: 10px;
margin-top: 7px;
}
}
// 导航部分
#nav{
position: relative;
.swiper-slide{
width: 100%;
height: 175px;
display: flex;
flex-wrap: wrap;
margin-top: 10px;
a{
width: 20%;
height: 70px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
flex-wrap: wrap;
img{
width: 40px;
}
span{
margin-top: 10px;
color: rgb(102,102,102);
font-size: 12px;
}
}
}
.swiper-pagination{
position: absolute;
left: 0;
right: 0;
text-align: center;
bottom: 0;
z-index: 10;
.swiper-pagination-bullet-active,.swiper-pagination-bullet{
width: 5px;
height: 5px;
border-radius: 5px;
background-color: #ccc;
opacity: 1;
}
.swiper-pagination-bullet-active{
background-color: rgb(200,37,25);
}
}
}
// 秒杀部分
#miaosha{
width: 100%;
height: 140px;
background-color: #fff;
margin-top: 10px;
border-radius:15px;
// 秒杀顶部
.m-top{
display: flex;
.m-top-word{
width: 70px;
height: 34px;
text-align: center;
line-height: 34px;
font-size: 14px;
justify-content: flex-start;
a{
color: black;
}
}
.m-top-date{
width: 25px;
height: 34px;
text-align: center;
line-height: 34px;
flex: 1;
a{
color: rgb(252,58,41);
}
}
.m-top-date::after{
width: 25px;
height: 17px;
content: '';
background-image: url(./img/点场.png);
background-position: 50%;
background-size: contain;
background-repeat: no-repeat;
display: inline-block;
}
.m-top-time{
height: 34px;
line-height: 34px;
flex: 5;
.time{
width: 15px;
height: 18px;
background-color: rgb(252,58,41);
border-radius: 3px;
color: #fff;
font-size: 14px;
}
}
.m-top-more{
width: 23px;
line-height: 35px;
img{
width: 12px;
height: 12px;
}
}
}
// 秒杀底部
.m-bottom{
.swiper-slide{
width: 375px;
height: 100px;
display: flex;
background-color: #fff;
margin-left: 10px;
a{
width: 16.66%;
height: 100px;
flex-direction: column;
justify-content: center;
align-items: center;
flex-wrap: wrap;
img{
width: 55px;
margin-left: -13px;
margin-top: 10px;
}
span{
color: rgb(252,58,41);
font-size: 14px;
font-weight: 600;
}
}
}
}
}
// 底部
#footer{
width: 100%;
height: 42px;
background-color: #fff;
box-shadow: 0 0 10px 0 hsl(0deg 6% 58% / 60%);
position: fixed;
bottom: 0;
display: flex;
z-index: 10;
a{
width: 25%;
justify-content: space-around;
display: flex;
img{
align-items: center;
width: 55px;
}
}
}
// 商品推荐
#goods{
width: 100%;
margin-top: 20px;
display: flex;
/* 换行 */
flex-wrap: wrap;
justify-content: space-evenly;
box-sizing: border-box;
.g-stamp{
width: 48%;
min-height: 250px;
box-sizing: border-box;
background: #fff;
margin-bottom: 15px;
border-radius: 15px;
margin-left: 3px;
margin-right: 3px;
>a>img{
width: 100%;
border-radius: 10px 10px 0px 0px;
}
.title{
width: 90%;
min-height: 30px;
font-size: 14px;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
margin-top: 5px;
color:#434343;
margin-left: 10px;
}
.pricemin{
display: inline-block;
margin-top: 2px;
font-size: 12px;
color: rgb(255,48,144);
background-color: #fff7ef;
margin-left: 10px;
}
.price{
margin-top: 6px;
font-size: 14px;
color: #ff4142;
margin-left: 10px;
.old-p{
font-size: 20px;
}
}
.pinglun{
color: #999;
font-size: 12px;
margin-left: 10px;
position: relative;
margin-top: -1px;
margin-bottom: 12px;
img{
align-items: center;
width: 24px;
margin-top: 8px;
}
.similar{
display: inline-block;
background-color: #f2f2f2;
color: #000;
font-size: 12px;
margin-top: 5px;
margin-bottom: 8px;
border-radius: 8px;
padding-right: 8px;
padding-left: 8px;
text-align: right;
position: absolute;
right: 10px;
bottom: -9px;
}
}
}
}
// 页面底部
#bottom{
width: 100%;
height: 200px;
background-color: #fff;
text-align: center;
.box-1{
width: 100%;
height: 58px;
// background-color: blanchedalmond;
display: flex;
border-top: 1px solid rgb(235,235,235);
border-bottom: 1px solid rgb(235,235,235);
.text{
flex: 1;
margin-top: 20px;
a{
color: #848689;
font-size: 14px;
}
}
.aaa{
color: rgb(235,235,235);
margin-top: 20px;
}
}
.box-2{
width: 100%;
height: 68.7px;
// background-color: chocolate;
display: flex;
border-bottom: 1px solid rgb(235,235,235);
div{
flex: 1;
margin-top: 5px;
img{
width: 60px;
}
}
}
.box-3{
width: 100%;
height: 33px;
// background-color: aqua;
color: #848689;
font-size: 12px;
margin-top: 6px;
}.box-4{
height: 42px;
}
}
// 右下角导航
#daohang{
position: fixed;
bottom: 110px;
right: 6px;
z-index: 11;
img{
width: 38px;
height: 38px;
}
}
JS:
window.onload = function(){
var swiper = new Swiper(".bannerSwiper", {
// 第一张和最后一张循环
loop: true,
pagination: {
el: ".swiper-pagination",
},
});
var swiper = new Swiper(".navSwiper", {
pagination: {
el: ".swiper-pagination",
},
});
var swiper = new Swiper(".bottomSwiper", {
slidesPerView: 6,
spaceBetween: 10,
});
var swiper = new Swiper(".innerSwiper", {
pagination: {
el: ".swiper-pagination",
dynamicBullets: true,
},
});
}
2、商品详细页面
HTML:
<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">
<title>易开得加热净水器 家用厨下式净水器加热直饮一体机真开水厨房RO反渗透纯水机 MS-JR2-800</title>
<link rel="stylesheet" href="./商品.css">
<link rel="stylesheet" href="./all.css">
<link rel="stylesheet" href="./swiper-bundle.min.css">
<script src="./swiper-bundle.min.js"></script>
<script src="./index.js"></script>
</head>
<body>
<!-- 轮播图部分 -->
<div id="inner">
<div class="swiper innerSwiper">
<div class="swiper-wrapper">
<div class="swiper-slide">
<img src="./img/商品轮播图1.jpg" alt="">
</div>
<div class="swiper-slide">
<img src="./img/商品轮播图2.jpg" alt="">
</div>
<div class="swiper-slide">
<img src="./img/商品轮播图3.jpg" alt="">
</div>
<div class="swiper-slide">
<img src="./img/商品轮播图4.jpg" alt="">
</div>
<div class="swiper-slide">
<img src="./img/商品轮播图5.jpg" alt="">
</div>
<div class="swiper-slide">
<img src="./img/商品轮播图6.jpg" alt="">
</div>
<div class="swiper-slide">
<img src="./img/商品轮播图7.jpg" alt="">
</div>
<div class="swiper-slide">
<img src="./img/商品轮播图8.jpg" alt="">
</div>
</div>
<div class="swiper-pagination"></div>
</div>
<div class="i-1">
<a href="./index.html"><img src="./img/返回2.png" alt=""></a>
</div>
<div class="i-2">
<a href="#"><img src="./img/更多.png" alt=""></a>
</div>
</div>
<!-- 海报 -->
<div id="haibao">
<img src="./img/清凉节.png" alt="">
</div>
<!-- 价格部分 -->
<div id="pricewrap">
<div class="price-top">
<p class="price"><span>¥</span><span class="old-p">4580</span>.00</p>
<div class="tubiao"><img src="./img/降价提醒.png" alt=""><p>降价提醒</p></div>
<div class="tubiao"><img src="./img/收藏.png" alt=""><p>收藏</p></div>
</div>
<div class="price-bottom">
<div>易开得加热净水器 家用厨下式净水器加热直饮一体机真开水厨房RO反渗透纯水机 MS-JR2-800</div>
<div>到手价不高于3680!下单送滤芯,滤水壶,晒单送保温杯!</div>
<div>
<span class="ban"><img src="./img/排行榜.png" alt=""></span>
<span class="can">入选『深度净化的大通量净水器TOP』</span>
<span class="pan"><img src="./img/箭头.png" alt=""></span>
</div>
</div>
</div>
<!-- 优惠 -->
<div id="youhui">
<div class="y-top">
<div class="y-1">优惠</div>
<div class="y-2">
<span>满减</span>
<span>满4500元减900元</span>
</div>
<div class="y-3"><img src="./img/点点.png" alt=""></div>
</div>
<div class="y-bottom">
<div class="y-1">白条</div>
<div class="y-2">
<span>12期以上免息</span>
</div>
<div class="y-3"><img src="./img/点点.png" alt=""></div>
</div>
</div>
<!-- 选择部分 -->
<div id="xuanze">
<div>
<div class="y-1">已选</div>
<div class="y-2">
<span>MS-JR2-800,1个</span>
</div>
<div class="y-4">本商品支持京选服务、京东保障服务,点击可选服务</div>
<div class="y-3"><img src="./img/点点.png" alt=""></div>
</div>
<div>
<div class="y-1">送至</div>
<div class="y-2">
<span>北京朝阳区三环到四环之间</span>
</div>
<div class="y-4"><p class="y-p">现货</p><p> 现在下单,预计6月28日发货</p></div>
<div class="y-3"><img src="./img/点点.png" alt=""></div>
</div>
<div>
<div class="y-1">运费</div>
<div class="y-2">
<span>在线支付免运费</span>
</div>
</div>
<div>
<ul>
<li>商家发货&售后</li>
<li>7天无理由退货(安装后不支持)</li>
<li>特权保障</li>
<li>30天价保</li>
<li>送运费险</li>
<li>极速审核</li>
<li>可配送港澳台及海外</li>
</ul>
<div class="y-3"><img src="./img/点点.png" alt=""></div>
</div>
</div>
<!-- 评价部分 -->
<div id="comment">
<div>
<p class="pingjia">评价</p>
<p class="com-1">100+</p>
<p class="com-2">好评度 100%</p>
<img src="./img/向右箭头.png" alt="">
</div>
<div>
<span>美观大方(7)</span>
<span>非常好用(4)</span>
<span>安装快速(3)</span>
<span>十分静音(2)</span>
<span>出水稳定(2)</span>
<span>不占空间(2)</span>
<span>出水迅速(2)</span>
<span>颜色漂亮(1)</span>
<span>安全性强(1)</span>
<span>工艺精美(1)</span>
</div>
<div>
<img src="./img/头像1.jpg" alt="">
<span class="c-name">一***那</span>
<span class="xx-1"></span>
<span class="xx-2"></span>
<span class="xx-3"></span>
<span class="xx-4"></span>
<span class="xx-5"></span>
<span class="date">2023-05-27</span>
</div>
<div>哈哈!刚到货就被我家猫孩儿吸引到了,玩儿个不停。
盼望已久的易开得饮水机到货了,是我心急其实到货很快,我联系客服下午就接到安装师傅电话,我又喝上好水了,款式及功能是我喜欢及和需要的。总而言之非常满意的购物(保全价到位后那就更满意了),外观时尚用水方便一分钱一分货,物有所值!值得推荐呦!
安装师傅做事非常认真也很执着,给我推荐一个水源过滤器,给用水把了一道关,不用换滤芯操作省事。
我买的易开得饮水机产生废水,是我没有想到的,等安装完了,师傅告诉有废水,废水管已经放进下水管道密封好了,我还说什么,师傅干活都爬在地上了真不容易,如果提前告诉我,我就会把废水管儿引到外面,让它废物利用。
提个建议,水机产生废水,主播要提到,视频要提到,安装前也没有提到!我认为这是商家担心客户不理解这个问题,其实是很正常的,我20年前我用的水机就长生废水,我利用废水墩地洗桌布等,反而,不废水。
商品与实际商品一致
外包装质量,非常精致牢固,
快递小哥把货送到家放进屋里,很照顾我这个老人家,多谢他了🌹🌻这么沉的物件搬到三层不容易啊!道声辛苦了!🍎🌹🌼</div>
<div>
<img src="./img/评论图片1.jpg" alt="">
<img src="./img/评论图片2.jpg" alt="">
<img src="./img/评论图片3.jpg" alt="">
<img src="./img/评论图片4.jpg" alt="">
</div>
<span class="com-3">
<div>
<img src="./img/头像2.png" alt="">
<span class="c-name">j***k</span>
<span class="xx-1"></span>
<span class="xx-2"></span>
<span class="xx-3"></span>
<span class="xx-4"></span>
<span class="xx-5"></span>
<span class="date">2023-06-22</span>
</div>
<div>出水速度:出水速度很快,过滤的也很干净,非常喜欢 还有热水非常方便
静音效果:很好,基本没啥声音
外形设计:非常好看</div>
<div>
<img src="./img/评论图片5.jpg" alt="">
<img src="./img/评论图片6.jpg" alt="">
<img src="./img/评论图片7.jpg" alt="">
<img src="./img/评论图片8.jpg" alt="">
</div>
</span>
<div>查看全部评价</div>
</div>
<!-- 问答部分 -->
<div id="problem">
<div>
<p class="pingjia">问答</p>
<p class="com-2">暂无提问信息,去提问</p>
<img src="./img/向右箭头.png" alt="">
</div>
</div>
<!-- 店铺信息 -->
<div id="shop">
<div>
<img class="tx" src="./img/店铺头像.jpg" alt="">
<p>易开得官方旗舰店</p>
<img class="xing" src="./img/五星店铺.png" alt="">
</div>
<div>
<span class="s-left-1">
<p>113万</p>
<p class="desc">粉丝人数</p>
</span>
<span class="s-left-2">
<p>80</p>
<p class="desc">全部商品</p>
</span>
<span class="s-right">
<p class="desc">评价<span>4.30 | 高</span></p>
<p class="desc">物流<span>4.80 | 高</span></p>
<p class="desc">售后<span>4.20 | 中</span></p>
</span>
</div>
<div>
<span class="gz">关注店铺</span>
<span class="jr">进入店铺</span>
</div>
</div>
<!-- 高价回收 -->
<div id="gjhs">
<div>
<div class="y-2">
<img src="./img/高价回收.jpg" alt="">
<span>高价回收</span>
</div>
<div class="y-4">旧品回收,免费估价,极速到账</div>
<div class="y-3"><img src="./img/向右箭头.png" alt=""></div>
</div>
</div>
<!-- 猜你喜欢 -->
<div id="like">
<div><p class="pingjia">猜你喜欢</p></div>
<div>
<div>
<img src="./img/猜你喜欢1.jpg" alt="">
<p class="l-text">易开得 净水器 大通量纯水机家用直饮净水机双出水 RO反渗透净水器厨下式自来水过滤器</p>
<p class="price"><span>¥</span><span class="old-p">2680</span>.00</p>
</div>
<div>
<img src="./img/猜你喜欢2.jpg" alt="">
<p class="l-text">易开得即热净水器家用厨下式加热直饮一体机ro反渗透800G水龙头过滤器多档变温净水纯水机M3plus</p>
<p class="price"><span>¥</span><span class="old-p">3680</span>.00</p>
</div>
<div>
<img src="./img/猜你喜欢3.jpg" alt="">
<p class="l-text">易开得净水器 母婴适用家用台式净饮机 大通量无废水超滤机自来水过滤器净水器升级版 9001pro</p>
<p class="price"><span>¥</span><span class="old-p">2680</span>.00</p>
</div>
<div>
<img src="./img/猜你喜欢4.jpg" alt="">
<p class="l-text">易开得 净水器 家用厨下式净水机 智能操控1000G大通量直饮RO反渗透纯水机3036</p>
<p class="price"><span>¥</span><span class="old-p">4699</span>.00</p>
</div>
<div>
<img src="./img/猜你喜欢5.jpg" alt="">
<p class="l-text">施尔(Siwer)净水器家用大流量厨房厨下式台下直饮RO反渗透过滤器富锶矿物水 厨下净水器</p>
<p class="price"><span>¥</span><span class="old-p">3998</span>.00</p>
</div>
<div>
<img src="./img/猜你喜欢6.jpg" alt="">
<p class="l-text">易开得净水器家用 王一博同款前端净水12L/min 厨下分离式直饮RO纯水机600G 反渗透净水机MQ7 黑</p>
<p class="price"><span>¥</span><span class="old-p">3880</span>.00</p>
</div>
</div>
</div>
<!-- 商品介绍 -->
<div id="ping">
<div>商品介绍</div>
<div>规格参数</div>
<div>售后保障</div>
</div>
<!-- 图片 -->
<div id="photo">
<div class="p-1"><img src="./img/商品介绍1.jpg" alt=""></div>
<div class="p-2"><img src="./img/商品介绍2.jpg" alt=""></div>
<div class="p-3"><img src="./img/商品介绍3.jpg" alt=""></div>
<div class="p-3"><img src="./img/商品介绍4.jpg" alt=""></div>
<div class="p-4"><img src="./img/商品介绍5.jpg" alt=""></div>
<div class="p-3"><img src="./img/商品介绍6.jpg" alt=""></div>
<div class="p-5"><img src="./img/商品介绍7.jpg" alt=""></div>
<div class="p-3"><img src="./img/商品介绍8.jpg" alt=""></div>
<div class="p-3"><img src="./img/商品介绍9.jpg" alt=""></div>
<div class="p-3"><img src="./img/商品介绍10.jpg" alt=""></div>
<div class="p-3"><img src="./img/商品介绍11.jpg" alt=""></div>
<div class="p-3"><img src="./img/商品介绍12.jpg" alt=""></div>
<div class="p-3"><img src="./img/商品介绍13.jpg" alt=""></div>
<div class="p-3"><img src="./img/商品介绍14.jpg" alt=""></div>
<div class="p-3"><img src="./img/商品介绍15.jpg" alt=""></div>
<div class="p-3"><img src="./img/商品介绍16.jpg" alt=""></div>
<div class="p-3"><img src="./img/商品介绍17.jpg" alt=""></div>
<div class="p-3"><img src="./img/商品介绍18.jpg" alt=""></div>
<div class="p-3"><img src="./img/商品介绍19.jpg" alt=""></div>
<div class="p-3"><img src="./img/商品介绍20.jpg" alt=""></div>
<div class="p-3"><img src="./img/商品介绍21.jpg" alt=""></div>
<div class="p-6"><img src="./img/商品介绍22.jpg" alt=""></div>
</div>
<!-- 底部 -->
<div id="footer">
<div class="f-1">
<img src="./img/店铺.png" alt="">
<p>店铺</p>
</div>
<div class="f-1">
<img src="./img/客服.png" alt="">
<p>客服</p>
</div>
<div class="f-1">
<img src="./img/购物车1.png" alt="">
<p>购物车</p>
</div>
<div class="f-2">加入购物车</div>
<div class="f-3">立即购买</div>
</div>
</body>
CSS:
#inner {
width: 100%;
height: 375px;
text-align: center;
background-color: #f2f2f2;
position: relative;
}
#inner img {
width: 375px;
height: 100%;
}
#inner > .i-1 {
position: absolute;
width: 30px;
height: 30px;
top: 10px;
left: 10px;
z-index: 10;
background-color: #666;
border-radius: 50%;
}
#inner > .i-1 img {
width: 20px;
height: 20px;
padding-top: 4px;
padding-right: 2px;
}
#inner > .i-2 {
position: absolute;
width: 30px;
height: 30px;
top: 10px;
right: 10px;
z-index: 10;
background-color: #666;
border-radius: 50%;
}
#inner > .i-2 img {
width: 20px;
height: 20px;
padding-top: 4px;
padding-right: 1px;
}
#haibao {
width: 100%;
height: 100%;
text-align: center;
background-color: #fff;
}
#haibao img {
width: 100%;
height: 100%;
}
#pricewrap {
width: 100%;
height: 190px;
background-color: #fff;
border-radius: 0px 0px 15px 15px;
}
#pricewrap .price-top {
display: flex;
height: 60px;
}
#pricewrap .price-top .price {
padding-top: 10px;
padding-left: 15px;
font-size: 18px;
color: #f2270c;
flex: 8;
}
#pricewrap .price-top .price .old-p {
font-size: 30px;
}
#pricewrap .price-top .tubiao {
flex: 1;
width: 80px;
height: 32px;
font-size: 14px;
display: inline-block;
transform: scale(0.7);
text-align: center;
padding-top: 10px;
padding-right: 6px;
}
#pricewrap .price-top .tubiao img {
width: 25px;
height: 25px;
}
#pricewrap .price-bottom {
width: 100%;
height: 130px;
}
#pricewrap .price-bottom div:first-child {
color: #262626;
font-size: 16px;
line-height: 21px;
font-weight: 700;
padding-left: 15px;
padding-right: 15px;
}
#pricewrap .price-bottom div:nth-child(2) {
color: #262626;
font-size: 12px;
line-height: 1.3;
padding: 18px 0 0;
padding-left: 15px;
padding-right: 15px;
}
#pricewrap .price-bottom div:last-child {
width: 92%;
height: 25px;
background-color: #feebe9;
margin-top: 15px;
border-radius: 20px;
display: flex;
position: relative;
}
#pricewrap .price-bottom div:last-child .ban {
flex: 2;
}
#pricewrap .price-bottom div:last-child .ban img {
width: 65px;
height: 25px;
}
#pricewrap .price-bottom div:last-child .can {
flex: 16;
color: #FA2C19;
padding-left: 5px;
padding-top: 3px;
}
#pricewrap .price-bottom div:last-child .pan {
flex: 2;
position: absolute;
top: 5px;
right: 10px;
}
#pricewrap .price-bottom div:last-child .pan img {
width: 15px;
height: 13px;
}
#youhui {
width: 100%;
height: 96px;
background-color: #fff;
border-radius: 15px;
margin-top: 20px;
}
#youhui .y-top {
width: 90%;
height: 48px;
border-bottom: 1px solid #ebebeb;
position: relative;
}
#youhui .y-top .y-1 {
color: #262626;
font-weight: 700;
position: absolute;
top: 18px;
}
#youhui .y-top .y-2 {
position: absolute;
top: 18px;
left: 40px;
}
#youhui .y-top .y-2 span:first-child {
border: 1px solid red;
padding: 1px;
color: red;
}
#youhui .y-top .y-3 {
position: absolute;
top: 18px;
right: 10px;
}
#youhui .y-top .y-3 img {
width: 20px;
height: 20px;
}
#youhui .y-bottom {
width: 90%;
height: 48px;
position: relative;
}
#youhui .y-bottom .y-1 {
color: #262626;
font-weight: 700;
position: absolute;
top: 16px;
}
#youhui .y-bottom .y-2 {
position: absolute;
top: 16px;
left: 40px;
}
#youhui .y-bottom .y-3 {
position: absolute;
top: 16px;
right: 10px;
}
#youhui .y-bottom .y-3 img {
width: 20px;
height: 20px;
}
#xuanze {
width: 100%;
height: 285px;
background-color: #fff;
border-radius: 15px;
margin-top: 20px;
}
#xuanze > div:first-child {
width: 90%;
height: 76px;
border-bottom: 1px solid #ebebeb;
position: relative;
}
#xuanze > div:first-child .y-1 {
color: #262626;
font-weight: 700;
position: absolute;
top: 18px;
}
#xuanze > div:first-child .y-2 {
position: absolute;
top: 18px;
left: 40px;
}
#xuanze > div:first-child .y-3 {
position: absolute;
top: 18px;
right: 10px;
}
#xuanze > div:first-child .y-3 img {
width: 20px;
height: 20px;
}
#xuanze > div:first-child .y-4 {
position: absolute;
top: 36px;
left: -9px;
font-size: 14px;
display: inline-block;
transform: scale(0.7);
color: #8c8c8c;
}
#xuanze > div:nth-child(2) {
width: 90%;
height: 75px;
border-bottom: 1px solid #ebebeb;
position: relative;
}
#xuanze > div:nth-child(2) .y-1 {
color: #262626;
font-weight: 700;
position: absolute;
top: 18px;
}
#xuanze > div:nth-child(2) .y-2 {
position: absolute;
top: 18px;
left: 40px;
}
#xuanze > div:nth-child(2) .y-3 {
position: absolute;
top: 18px;
right: 10px;
}
#xuanze > div:nth-child(2) .y-3 img {
width: 20px;
height: 20px;
}
#xuanze > div:nth-child(2) .y-4 {
position: absolute;
top: 37px;
left: 9px;
font-size: 14px;
display: inline-block;
transform: scale(0.7);
color: #8c8c8c;
}
#xuanze > div:nth-child(2) .y-4 p {
display: inline;
}
#xuanze > div:nth-child(2) .y-4 .y-p {
color: #FA2C19;
}
#xuanze > div:nth-child(3) {
width: 90%;
height: 55px;
border-bottom: 1px solid #ebebeb;
position: relative;
}
#xuanze > div:nth-child(3) .y-1 {
color: #262626;
font-weight: 700;
position: absolute;
top: 18px;
}
#xuanze > div:nth-child(3) .y-2 {
position: absolute;
top: 18px;
left: 40px;
}
#xuanze > div:last-child {
height: 78px;
background-color: #fafafa;
border-radius: 0px 0px 15px 15px;
position: relative;
}
#xuanze > div:last-child ul {
width: 90%;
}
#xuanze > div:last-child ul li {
color: #8c8c8c;
display: inline-block;
line-height: 1;
padding: 3px 12px 3px 0;
}
#xuanze > div:last-child ul li::before {
background-image: url(img/勾.png);
background-size: 11px auto;
content: "";
display: inline-block;
height: 11px;
margin-right: 6px;
margin-top: -2px;
vertical-align: middle;
width: 11px;
}
#xuanze > div:last-child .y-3 {
position: absolute;
top: 9px;
right: 28px;
}
#xuanze > div:last-child .y-3 img {
width: 20px;
height: 20px;
}
#comment {
width: 100%;
height: 624px;
background-color: #fff;
border-radius: 15px 15px 0 0;
margin-top: 20px;
}
#comment > div:first-child {
width: 90%;
height: 45px;
position: relative;
}
#comment > div:first-child p {
display: block;
position: absolute;
}
#comment > div:first-child .pingjia {
font-size: 16px;
color: #262626;
font-weight: 700;
left: -2px;
top: 14px;
padding-left: 10px;
}
#comment > div:first-child .pingjia::after {
background-image: linear-gradient(180deg, #f5503a, #fad1cb);
content: "";
height: 15px;
left: 0;
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 3px;
}
#comment > div:first-child .com-1 {
font-family: JDZhengHei-01-Bold;
left: 45px;
top: 20px;
}
#comment > div:first-child .com-2 {
right: 23px;
top: 17px;
color: #8c8c8c;
}
#comment > div:first-child > img {
position: absolute;
top: 20px;
right: 3px;
width: 12px;
height: 12px;
}
#comment > div:nth-child(2) {
width: 90%;
max-height: 83px;
position: relative;
padding: 3px 3px 0 0;
overflow: hidden;
}
#comment > div:nth-child(2) span {
background: #fcedeb;
border-radius: 15px;
margin: 0 12px 12px 0;
color: #262626;
display: inline-block;
font-size: 11px;
height: 30px;
line-height: 30px;
padding: 0 10px;
}
#comment > div:nth-child(3) {
width: 90%;
height: 22px;
position: relative;
padding-top: 8px;
}
#comment > div:nth-child(3) img {
width: 20px;
height: 20px;
border-radius: 50%;
vertical-align: middle;
}
#comment > div:nth-child(3) span {
margin-left: 8px;
}
#comment > div:nth-child(3) .c-name {
color: #262626;
position: absolute;
top: 10px;
}
#comment > div:nth-child(3) .xx-1::before {
background-image: url(img/星星.png);
background-size: cover;
content: "";
display: inline-block;
height: 10px;
position: absolute;
top: 15px;
left: 80px;
width: 10px;
}
#comment > div:nth-child(3) .xx-2::before {
background-image: url(img/星星.png);
background-size: cover;
content: "";
display: inline-block;
height: 10px;
position: absolute;
top: 15px;
left: 93px;
width: 10px;
}
#comment > div:nth-child(3) .xx-3::before {
background-image: url(img/星星.png);
background-size: cover;
content: "";
display: inline-block;
height: 10px;
position: absolute;
top: 15px;
left: 106px;
width: 10px;
}
#comment > div:nth-child(3) .xx-4::before {
background-image: url(img/星星.png);
background-size: cover;
content: "";
display: inline-block;
height: 10px;
position: absolute;
top: 15px;
left: 119px;
width: 10px;
}
#comment > div:nth-child(3) .xx-5::before {
background-image: url(img/星星.png);
background-size: cover;
content: "";
display: inline-block;
height: 10px;
position: absolute;
top: 15px;
left: 132px;
width: 10px;
}
#comment > div:nth-child(3) .date {
position: absolute;
top: 13px;
right: 7px;
color: #999;
}
#comment > div:nth-child(4) {
width: 90%;
height: 54.5px;
position: relative;
margin: 18px 18px 18px 18px;
overflow: hidden;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
display: -webkit-box;
}
#comment > div:nth-child(5) {
width: 90%;
height: 100px;
border-bottom: 1px solid #ebebeb;
}
#comment > div:nth-child(5) > img {
height: 80px;
width: 80px;
border-radius: 6px;
}
#comment > .com-3 {
width: 90%;
}
#comment > .com-3 > div:nth-child(1) {
width: 90%;
height: 22px;
position: relative;
padding-top: 8px;
}
#comment > .com-3 > div:nth-child(1) img {
width: 20px;
height: 20px;
border-radius: 50%;
vertical-align: middle;
}
#comment > .com-3 > div:nth-child(1) span {
margin-left: 8px;
}
#comment > .com-3 > div:nth-child(1) .c-name {
color: #262626;
position: absolute;
top: 10px;
}
#comment > .com-3 > div:nth-child(1) .xx-1::before {
background-image: url(img/星星.png);
background-size: cover;
content: "";
display: inline-block;
height: 10px;
position: absolute;
top: 15px;
left: 80px;
width: 10px;
}
#comment > .com-3 > div:nth-child(1) .xx-2::before {
background-image: url(img/星星.png);
background-size: cover;
content: "";
display: inline-block;
height: 10px;
position: absolute;
top: 15px;
left: 93px;
width: 10px;
}
#comment > .com-3 > div:nth-child(1) .xx-3::before {
background-image: url(img/星星.png);
background-size: cover;
content: "";
display: inline-block;
height: 10px;
position: absolute;
top: 15px;
left: 106px;
width: 10px;
}
#comment > .com-3 > div:nth-child(1) .xx-4::before {
background-image: url(img/星星.png);
background-size: cover;
content: "";
display: inline-block;
height: 10px;
position: absolute;
top: 15px;
left: 119px;
width: 10px;
}
#comment > .com-3 > div:nth-child(1) .xx-5::before {
background-image: url(img/星星.png);
background-size: cover;
content: "";
display: inline-block;
height: 10px;
position: absolute;
top: 15px;
left: 132px;
width: 10px;
}
#comment > .com-3 > div:nth-child(1) .date {
position: absolute;
top: 13px;
right: 7px;
color: #999;
}
#comment > .com-3 > div:nth-child(2) {
width: 90%;
height: 54.5px;
position: relative;
margin: 18px 18px 18px 18px;
overflow: hidden;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
display: -webkit-box;
}
#comment > .com-3 > div:nth-child(3) {
width: 90%;
height: 100px;
}
#comment > .com-3 > div:nth-child(3) > img {
height: 80px;
width: 80px;
border-radius: 6px;
}
#comment > div:last-child {
width: 25%;
line-height: 25px;
padding: 0 5px 0 10px;
text-align: center;
border: 1px solid #ddd;
border-radius: 20px;
}
#problem {
width: 100%;
height: 44px;
background-color: #fff;
border-radius: 0 0 15px 15px;
margin-top: 2px;
}
#problem > div:first-child {
width: 90%;
height: 44px;
position: relative;
}
#problem > div:first-child p {
display: block;
position: absolute;
}
#problem > div:first-child .pingjia {
font-size: 16px;
color: #262626;
font-weight: 700;
left: -2px;
top: 14px;
padding-left: 10px;
}
#problem > div:first-child .pingjia::after {
background-image: linear-gradient(180deg, #f5503a, #fad1cb);
content: "";
height: 15px;
left: 0;
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 3px;
}
#problem > div:first-child .com-2 {
right: 23px;
top: 17px;
color: #8c8c8c;
}
#problem > div:first-child > img {
position: absolute;
top: 20px;
right: 3px;
width: 12px;
height: 12px;
}
#shop {
width: 100%;
height: 196px;
background-color: #fff;
border-radius: 15px;
margin-top: 20px;
}
#shop > div:first-child {
width: 90%;
height: 40px;
margin-top: 12px;
position: relative;
}
#shop > div:first-child .tx {
width: 40px;
height: 40px;
border-radius: 6px;
position: absolute;
top: 15px;
left: 5px;
}
#shop > div:first-child > p {
font-size: 13px;
position: absolute;
top: 26px;
left: 55px;
}
#shop > div:first-child .xing {
height: 13px;
position: absolute;
top: 29px;
left: 168px;
}
#shop > div:nth-child(2) {
width: 90%;
height: 60px;
display: flex;
margin-top: 30px;
}
#shop > div:nth-child(2) .s-left-1 {
flex: 1;
height: 90%;
text-align: center;
line-height: 1.5;
border-right: 1px solid #ddd;
padding: 2px 0;
}
#shop > div:nth-child(2) .s-left-1 .desc {
color: #999;
margin-top: 3px;
}
#shop > div:nth-child(2) .s-left-2 {
flex: 1;
height: 90%;
text-align: center;
line-height: 1.5;
padding: 2px 0;
}
#shop > div:nth-child(2) .s-left-2 .desc {
color: #999;
margin-top: 3px;
}
#shop > div:nth-child(2) .s-right .desc {
color: #999;
margin-top: 3px;
}
#shop > div:nth-child(2) .s-right .desc > span {
color: #e4393c;
margin-left: 5px;
}
#shop > div:last-child {
width: 60%;
height: 30px;
text-align: center;
display: flex;
margin-top: 16px;
}
#shop > div:last-child .gz {
flex: 1;
border: 1px solid #ddd;
border-radius: 15px;
padding-top: 5px;
}
#shop > div:last-child .jr {
flex: 1;
border: 1px solid #ddd;
border-radius: 15px;
padding-top: 5px;
margin-left: 8px;
}
#gjhs {
width: 100%;
height: 66px;
background-color: #fff;
border-radius: 15px;
margin-top: 20px;
position: relative;
}
#gjhs .y-2 {
position: absolute;
top: 16px;
left: 20px;
}
#gjhs .y-2 > img {
width: 14px;
height: 14px;
margin-right: 2px;
}
#gjhs .y-3 {
position: absolute;
top: 25px;
right: 10px;
}
#gjhs .y-3 img {
width: 12px;
height: 12px;
}
#gjhs .y-4 {
position: absolute;
top: 40px;
left: 10px;
font-size: 14px;
display: inline-block;
transform: scale(0.7);
color: #8c8c8c;
}
#like {
width: 100%;
height: 438px;
background-color: #fff;
border-radius: 15px;
margin-top: 20px;
}
#like > div:first-child {
width: 90%;
height: 44px;
position: relative;
}
#like > div:first-child p {
display: block;
position: absolute;
}
#like > div:first-child .pingjia {
font-size: 16px;
color: #262626;
font-weight: 700;
left: -2px;
top: 14px;
padding-left: 10px;
}
#like > div:first-child .pingjia::after {
background-image: linear-gradient(180deg, #f5503a, #fad1cb);
content: "";
height: 15px;
left: 0;
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 3px;
}
#like > div:last-child {
width: 95%;
height: 393px;
}
#like > div:last-child > div {
width: 30%;
height: 180px;
float: left;
margin-left: 10px;
margin-top: 10px;
}
#like > div:last-child > div img {
width: 100%;
height: 105px;
border-radius: 15px;
text-align: center;
}
#like > div:last-child > div .l-text {
padding: 7px 0 0;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
height: 35px;
}
#like > div:last-child > div .price {
font-size: 12px;
color: #f2270c;
}
#like > div:last-child > div .price .old-p {
font-size: 16px;
}
#ping {
width: 100%;
height: 61px;
background-color: #fff;
border-radius: 15px;
margin-top: 20px;
display: flex;
text-align: center;
}
#ping > div {
flex: 1;
margin-top: 22px;
}
#photo {
width: 100%;
height: 12900px;
background-color: #fff;
text-align: center;
}
#photo .p-1 > img {
width: 375px;
height: 1406px;
}
#photo .p-2 > img {
width: 375px;
height: 562.5px;
}
#photo .p-3 > img {
width: 375px;
height: 562.5px;
margin-top: -4px;
}
#photo .p-4 > img {
width: 375px;
height: 557.22px;
margin-top: -4px;
}
#photo .p-5 > img {
width: 375px;
height: 557.81px;
margin-top: -4px;
}
#photo .p-6 > img {
width: 375px;
height: 188.67px;
margin-top: -4px;
}
#footer {
width: 100%;
height: 50px;
position: fixed;
bottom: 0;
background-color: #fff;
display: flex;
text-align: center;
z-index: 12;
}
#footer .f-1 {
flex: 1;
margin-top: 6px;
}
#footer .f-1 > img {
width: 20px;
height: 20px;
}
#footer .f-2 {
flex: 2;
align-items: center;
border-radius: 21px;
box-sizing: border-box;
color: #fff;
background-image: linear-gradient(135deg, #f2140c, #f2270c 70%, #f24d0c);
height: 38px;
margin-top: 7px;
padding-top: 8px;
}
#footer .f-3 {
flex: 2;
align-items: center;
border-radius: 21px;
box-sizing: border-box;
color: #fff;
background-image: linear-gradient(135deg, #ffba0d, #ffc30d 69%, #ffcf0d);
height: 38px;
margin-top: 7px;
padding-top: 8px;
margin-left: 6px;
}
LESS:
// 轮播图部分
#inner{
width: 100%;
height: 375px;
text-align: center;
background-color: rgb(242,242,242);
position: relative;
img{
width: 375px;
height: 100%;
}
>.i-1{
position: absolute;
width: 30px;
height: 30px;
top: 10px;
left: 10px;
z-index: 10;
background-color: #666;
border-radius: 50%;
img{
width: 20px;
height: 20px;
padding-top: 4px;
padding-right: 2px;
}
}
>.i-2{
position: absolute;
width: 30px;
height: 30px;
top: 10px;
right: 10px;
z-index: 10;
background-color: #666;
border-radius: 50%;
img{
width: 20px;
height: 20px;
padding-top: 4px;
padding-right: 1px;
}
}
}
// 海报
#haibao{
width: 100%;
height: 100%;
text-align: center;
background-color: #fff;
img{
width: 100%;
height: 100%;
}
}
// 价格部分
#pricewrap{
width: 100%;
height: 190px;
background-color: #fff;
border-radius: 0px 0px 15px 15px;
.price-top{
display: flex;
height: 60px;
.price{
padding-top: 10px;
padding-left: 15px;
font-size: 18px;
color: rgb(242,39,12);
flex: 8;
.old-p{
font-size: 30px;
}
}
.tubiao{
flex: 1;
width: 80px;
height: 32px;
font-size: 14px;
display: inline-block;
transform: scale(0.7);
text-align: center;
padding-top: 10px;
padding-right: 6px;
img{
width: 25px;
height: 25px;
}
}
}
.price-bottom{
width: 100%;
height: 130px;
div:first-child{
color: #262626;
font-size: 16px;
line-height: 21px;
font-weight: 700;
padding-left: 15px;
padding-right: 15px;
}
div:nth-child(2){
color: #262626;
font-size: 12px;
line-height: 1.3;
padding: 18px 0 0;
padding-left: 15px;
padding-right: 15px;
}
div:last-child{
width: 92%;
height: 25px;
background-color: rgb(254,235,233);
margin-top: 15px;
border-radius: 20px;
display: flex;
position: relative;
.ban{
flex: 2;
img{
width: 65px;
height: 25px;
}
}
.can{
flex: 16;
color: #FA2C19;
padding-left: 5px;
padding-top: 3px;
}
.pan{
flex: 2;
position: absolute;
top: 5px;
right: 10px;
img{
width: 15px;
height: 13px;
}
}
}
}
}
// 优惠
#youhui{
width: 100%;
height: 96px;
background-color: #fff;
border-radius: 15px;
margin-top: 20px;
.y-top{
width: 90%;
height: 48px;
border-bottom: 1px solid rgb(235,235,235);
position: relative;
.y-1{
color: #262626;
font-weight: 700;
position: absolute;
top: 18px;
}
.y-2{
position: absolute;
top: 18px;
left: 40px;
span:first-child{
border: 1px solid red;
padding: 1px;
color: red;
}
}
.y-3{
position: absolute;
top: 18px;
right: 10px;
img{
width: 20px;
height: 20px;
}
}
}
.y-bottom{
width: 90%;
height: 48px;
position: relative;
.y-1{
color: #262626;
font-weight: 700;
position: absolute;
top: 16px;
}
.y-2{
position: absolute;
top: 16px;
left: 40px;
}
.y-3{
position: absolute;
top: 16px;
right: 10px;
img{
width: 20px;
height: 20px;
}
}
}
}
// 选择部分
#xuanze{
width: 100%;
height: 285px;
background-color: #fff;
border-radius: 15px;
margin-top: 20px;
>div:first-child{
width: 90%;
height: 76px;
border-bottom: 1px solid rgb(235,235,235);
position: relative;
.y-1{
color: #262626;
font-weight: 700;
position: absolute;
top: 18px;
}
.y-2{
position: absolute;
top: 18px;
left: 40px;
}
.y-3{
position: absolute;
top: 18px;
right: 10px;
img{
width: 20px;
height: 20px;
}
}
.y-4{
position: absolute;
top: 36px;
left: -9px;
font-size: 14px;
display: inline-block;
transform: scale(0.7);
color: #8c8c8c;
}
}
>div:nth-child(2){
width: 90%;
height: 75px;
border-bottom: 1px solid rgb(235,235,235);
position: relative;
.y-1{
color: #262626;
font-weight: 700;
position: absolute;
top: 18px;
}
.y-2{
position: absolute;
top: 18px;
left: 40px;
}
.y-3{
position: absolute;
top: 18px;
right: 10px;
img{
width: 20px;
height: 20px;
}
}
.y-4{
position: absolute;
top: 37px;
left: 9px;
font-size: 14px;
display: inline-block;
transform: scale(0.7);
color: #8c8c8c;
p{
display:inline;
}
.y-p{
color: #FA2C19;
}
}
}
>div:nth-child(3){
width: 90%;
height: 55px;
border-bottom: 1px solid rgb(235,235,235);
position: relative;
.y-1{
color: #262626;
font-weight: 700;
position: absolute;
top: 18px;
}
.y-2{
position: absolute;
top: 18px;
left: 40px;
}
}
>div:last-child{
height: 72px;
background-color: #fafafa;
border-radius: 0px 0px 15px 15px;
position: relative;
ul{
width: 90%;
li{
color: #8c8c8c;
display: inline-block;
line-height: 1;
padding: 3px 12px 3px 0;
}
li::before{
background-image: url(./img/勾.png);
background-size: 11px auto;
content: "";
display: inline-block;
height: 11px;
margin-right: 6px;
margin-top: -2px;
vertical-align: middle;
width: 11px;
}
}
.y-3{
position: absolute;
top: 9px;
right: 28px;
img{
width: 20px;
height: 20px;
}
}
}
}
// 评价部分
#comment{
width: 100%;
height: 624px;
background-color: #fff;
border-radius: 15px 15px 0 0;
margin-top: 20px;
>div:first-child{
width: 90%;
height: 45px;
position: relative;
p{
display: block;
position: absolute;
}
.pingjia{
font-size: 16px;
color: #262626;
font-weight: 700;
left: -2px;
top: 14px;
padding-left: 10px;
}
.pingjia::after{
background-image: linear-gradient(180deg,#f5503a,#fad1cb);
content: "";
height: 15px;
left: 0;
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 3px;
}
.com-1{
font-family: JDZhengHei-01-Bold;
left: 45px;
top: 20px;
}
.com-2{
right: 23px;
top: 17px;
color: #8c8c8c;
}
>img{
position: absolute;
top: 20px;
right: 3px;
width: 12px;
height: 12px;
}
}
>div:nth-child(2){
width: 90%;
max-height: 83px;
position: relative;
padding: 3px 3px 0 0;
overflow: hidden;
span{
background: #fcedeb;
border-radius: 15px;
margin: 0 12px 12px 0;
color: #262626;
display: inline-block;
font-size: 11px;
height: 30px;
line-height: 30px;
padding: 0 10px;
}
}
>div:nth-child(3){
width: 90%;
height: 22px;
position: relative;
padding-top: 8px;
img{
width: 20px;
height: 20px;
border-radius: 50%;
vertical-align: middle;
}
span{
margin-left: 8px;
}
.c-name{
color: #262626;
position: absolute;
top: 10px;
}
.xx-1::before{
background-image: url(./img/星星.png);
background-size: cover;
content: "";
display: inline-block;
height: 10px;
position: absolute;
top: 15px;
left: 80px;
width: 10px;
}
.xx-2::before{
background-image: url(./img/星星.png);
background-size: cover;
content: "";
display: inline-block;
height: 10px;
position: absolute;
top: 15px;
left: 93px;
width: 10px;
}
.xx-3::before{
background-image: url(./img/星星.png);
background-size: cover;
content: "";
display: inline-block;
height: 10px;
position: absolute;
top: 15px;
left: 106px;
width: 10px;
}
.xx-4::before{
background-image: url(./img/星星.png);
background-size: cover;
content: "";
display: inline-block;
height: 10px;
position: absolute;
top: 15px;
left: 119px;
width: 10px;
}
.xx-5::before{
background-image: url(./img/星星.png);
background-size: cover;
content: "";
display: inline-block;
height: 10px;
position: absolute;
top: 15px;
left: 132px;
width: 10px;
}
.date{
position: absolute;
top: 13px;
right: 7px;
color: #999;
}
}
>div:nth-child(4){
width: 90%;
height: 54.5px;
position: relative;
margin: 18px 18px 18px 18px;
overflow: hidden;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
display: -webkit-box;
}
>div:nth-child(5){
width: 90%;
height: 100px;
border-bottom: 1px solid rgb(235,235,235);
>img{
height: 80px;
width: 80px;
border-radius: 6px;
}
}
>.com-3{
width: 90%;
>div:nth-child(1){
width: 90%;
height: 22px;
position: relative;
padding-top: 8px;
img{
width: 20px;
height: 20px;
border-radius: 50%;
vertical-align: middle;
}
span{
margin-left: 8px;
}
.c-name{
color: #262626;
position: absolute;
top: 10px;
}
.xx-1::before{
background-image: url(./img/星星.png);
background-size: cover;
content: "";
display: inline-block;
height: 10px;
position: absolute;
top: 15px;
left: 80px;
width: 10px;
}
.xx-2::before{
background-image: url(./img/星星.png);
background-size: cover;
content: "";
display: inline-block;
height: 10px;
position: absolute;
top: 15px;
left: 93px;
width: 10px;
}
.xx-3::before{
background-image: url(./img/星星.png);
background-size: cover;
content: "";
display: inline-block;
height: 10px;
position: absolute;
top: 15px;
left: 106px;
width: 10px;
}
.xx-4::before{
background-image: url(./img/星星.png);
background-size: cover;
content: "";
display: inline-block;
height: 10px;
position: absolute;
top: 15px;
left: 119px;
width: 10px;
}
.xx-5::before{
background-image: url(./img/星星.png);
background-size: cover;
content: "";
display: inline-block;
height: 10px;
position: absolute;
top: 15px;
left: 132px;
width: 10px;
}
.date{
position: absolute;
top: 13px;
right: 7px;
color: #999;
}
}
>div:nth-child(2){
width: 90%;
height: 54.5px;
position: relative;
margin: 18px 18px 18px 18px;
overflow: hidden;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
display: -webkit-box;
}
>div:nth-child(3){
width: 90%;
height: 100px;
>img{
height: 80px;
width: 80px;
border-radius: 6px;
}
}
}
>div:last-child{
width: 25%;
line-height: 25px;
padding: 0 5px 0 10px;
text-align: center;
border: 1px solid #ddd;
border-radius: 20px;
}
}
// 问答部分
#problem{
width: 100%;
height: 44px;
background-color: #fff;
border-radius: 0 0 15px 15px;
margin-top: 2px;
>div:first-child{
width: 90%;
height: 44px;
position: relative;
p{
display: block;
position: absolute;
}
.pingjia{
font-size: 16px;
color: #262626;
font-weight: 700;
left: -2px;
top: 14px;
padding-left: 10px;
}
.pingjia::after{
background-image: linear-gradient(180deg,#f5503a,#fad1cb);
content: "";
height: 15px;
left: 0;
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 3px;
}
.com-2{
right: 23px;
top: 17px;
color: #8c8c8c;
}
>img{
position: absolute;
top: 20px;
right: 3px;
width: 12px;
height: 12px;
}
}
}
// 店铺部分
#shop{
width: 100%;
height: 196px;
background-color: #fff;
border-radius: 15px;
margin-top: 20px;
>div:first-child{
width: 90%;
height: 40px;
margin-top: 12px;
position: relative;
.tx{
width: 40px;
height: 40px;
border-radius: 6px;
position: absolute;
top: 15px;
left: 5px;
}
>p{
font-size: 13px;
position: absolute;
top: 26px;
left: 55px;
}
.xing{
height: 13px;
position: absolute;
top: 29px;
left: 168px;
}
}
>div:nth-child(2){
width: 90%;
height: 60px;
display: flex;
margin-top: 30px;
.s-left-1{
flex: 1;
height: 90%;
text-align: center;
line-height: 1.5;
border-right: 1px solid #ddd;
padding: 2px 0;
.desc{
color: #999;
margin-top: 3px;
}
}
.s-left-2{
flex: 1;
height: 90%;
text-align: center;
line-height: 1.5;
padding: 2px 0;
.desc{
color: #999;
margin-top: 3px;
}
}
.s-right{
.desc{
color: #999;
margin-top: 3px;
>span{
color: #e4393c;
margin-left: 5px;
}
}
}
}
>div:last-child{
width: 60%;
height: 30px;
text-align: center;
display: flex;
margin-top: 16px;
.gz{
flex: 1;
border: 1px solid #ddd;
border-radius: 15px;
padding-top: 5px;
}
.jr{
flex: 1;
border: 1px solid #ddd;
border-radius: 15px;
padding-top: 5px;
margin-left: 8px;
}
}
}
// 高价回收
#gjhs{
width: 100%;
height: 66px;
background-color: #fff;
border-radius: 15px;
margin-top: 20px;
position: relative;
.y-2{
position: absolute;
top: 16px;
left: 20px;
>img{
width: 14px;
height: 14px;
margin-right: 2px;
}
}
.y-3{
position: absolute;
top: 25px;
right: 10px;
img{
width: 12px;
height: 12px;
}
}
.y-4{
position: absolute;
top: 40px;
left: 10px;
font-size: 14px;
display: inline-block;
transform: scale(0.7);
color: #8c8c8c;
}
}
// 猜你喜欢
#like{
width: 100%;
height: 438px;
background-color: #fff;
border-radius: 15px;
margin-top: 20px;
>div:first-child{
width: 90%;
height: 44px;
position: relative;
p{
display: block;
position: absolute;
}
.pingjia{
font-size: 16px;
color: #262626;
font-weight: 700;
left: -2px;
top: 14px;
padding-left: 10px;
}
.pingjia::after{
background-image: linear-gradient(180deg,#f5503a,#fad1cb);
content: "";
height: 15px;
left: 0;
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 3px;
}
}
>div:last-child{
width: 95%;
height: 393px;
>div{
width: 30%;
height: 180px;
// background-color: #e4393c;
float: left;
margin-left: 10px;
margin-top: 10px;
img{
width: 100%;
height: 105px;
border-radius: 15px;
text-align: center;
}
.l-text{
padding: 7px 0 0;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
height: 35px;
}
.price{
font-size: 12px;
color: rgb(242,39,12);
.old-p{
font-size: 16px;
}
}
}
}
}
// 商品介绍
#ping{
width: 100%;
height: 61px;
background-color: #fff;
border-radius: 15px;
margin-top: 20px;
display: flex;
text-align: center;
>div{
flex: 1;
margin-top: 22px;
}
}
// 图片
#photo{
width: 100%;
height: 12900px;
background-color: #fff;
text-align: center;
.p-1>img{
width: 375px;
height: 1406px;
}
.p-2>img{
width: 375px;
height: 562.5px;
}
.p-3>img{
width: 375px;
height: 562.5px;
margin-top: -4px;
}
.p-4>img{
width: 375px;
height: 557.22px;
margin-top: -4px;
}
.p-5>img{
width: 375px;
height: 557.81px;
margin-top: -4px;
}
.p-6>img{
width: 375px;
height: 188.67px;
margin-top: -4px;
}
}
// 底部
#footer{
width: 100%;
height: 50px;
position: fixed;
bottom: 0;
background-color: #fff;
display: flex;
text-align: center;
z-index: 12;
.f-1{
flex: 1;
margin-top: 6px;
>img{
width: 20px;
height: 20px;
}
}
.f-2{
flex: 2;
align-items: center;
border-radius: 21px;
box-sizing: border-box;
color: #fff;
background-image: linear-gradient(135deg,#f2140c,#f2270c 70%,#f24d0c);
height: 38px;
margin-top: 7px;
padding-top: 8px;
}
.f-3{
flex: 2;
align-items: center;
border-radius: 21px;
box-sizing: border-box;
color: #fff;
background-image: linear-gradient(135deg,#ffba0d,#ffc30d 69%,#ffcf0d);
height: 38px;
margin-top: 7px;
padding-top: 8px;
margin-left: 6px;
}
}
3、购物车页面
HTML:
<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">
<title>购物车</title>
<link rel="stylesheet" href="./购物车.css">
<link rel="stylesheet" href="./all.css">
</head>
<body>
<!-- 头部 -->
<div id="top">
<a href="./index.html"><img src="./img/向左箭头.png" alt=""></a>
<div>购物车</div>
<img src="./img/点点2.png" alt="">
</div>
<!-- 登录 -->
<div id="dl">登录后可同步账户购物车中的商品<a href="./登录页.html">登录</a></div>
<!-- 中间部分 -->
<div id="middle">
<div></div>
<p>登录后可同步购物车中商品</p>
<img src="./img/打开京东.png" alt="">
</div>
<!-- 分界线 -->
<div id="fjx">
<div></div>
<div>可能你还想要</div>
<div></div>
</div>
<!-- 商品推荐 -->
<div id="goods">
<div class="g-stamp"><a href="./商品.html">
<img src="./img/购物车商品1.jpg" alt="">
<span class="title">可菱水(CLEANSUI) CGC4W 净水器滤芯 适用于水龙头净水器CG104专用净水过滤器滤水器 日本原装进口 三菱替换过滤芯(两只装)</span>
<div class="pricemin">15天最低价</div>
<p class="price"><span>¥</span><span class="old-p">408</span>.00</p>
<div class="pinglun">100+条评论<div class="similar">看相似</div></div>
</a></div>
<div class="g-stamp"><a href="#">
<img src="./img/购物车商品2.jpg" alt="">
<span class="title">可菱水(CLEANSUI) 净水器 水龙头过滤器 家用可直饮厨房自来水前置超滤芯滤水器 日本原装进口三档出水龙头型滤水器 【78%选】CBC03W滤芯*3芯装(含三菱机身)</span>
<p class="price"><span>¥</span><span class="old-p">648</span>.00</p>
<div class="pinglun"><img src="./img/自营.png" alt=""><div class="similar">看相似</div></div>
</a></div>
<div class="g-stamp"><a href="#">
<img src="./img/购物车商品3.jpg" alt="">
<span class="title">BRETEUIL适配净水壶家用净水壶滤芯过滤水壶净水器德国通用三代滤芯自来水过滤器 6支专家版滤芯</span>
<p class="price"><span>¥</span><span class="old-p">138</span>.00</p>
<div class="pinglun">1万+条评论<div class="similar">看相似</div></div>
</a></div>
<div class="g-stamp"><a href="#">
<img src="./img/购物车商品4.jpg" alt="">
<span class="title">婴儿级净水器·高效滤菌去垢·母婴直饮</span>
<p class="price"><span>¥</span><span class="old-p">2799</span>.00</p>
<div class="pinglun">500+条评论<div class="similar">看相似</div></div>
</a></div>
<div class="g-stamp"><a href="#">
<img src="./img/购物车商品5.jpg" alt="">
<span class="title">可菱水(CLEANSUI) 净水器家用直饮 水龙头过滤器台式净水机净饮机自来水前置饮水机台上型净水器 日本进口 三菱净水器 Q303</span>
<div class="pricemin">7天最低价</div>
<p class="price"><span>¥</span><span class="old-p">858</span>.00</p>
<div class="pinglun">2000+条评论<div class="similar">看相似</div></div>
</a></div>
<div class="g-stamp"><a href="#">
<img src="./img/购物车商品6.jpg" alt="">
<span class="title">美家厨帮 304不锈钢方盘加深托盘长方形大尺寸家用烤鱼烤箱烤盘提拉米苏盘子加厚菜盘平盘厨房凉皮肠粉盘 日式浅方盘27*21*2(304钢)</span>
<p class="price"><span>¥</span><span class="old-p">19</span>.90</p>
<div class="pinglun"><img src="./img/自营.png" alt=""><div>1万+条评论</div>
<div class="similar">看相似</div></div>
</a></div>
<div class="g-stamp"><a href="#">
<img src="./img/购物车商品7.jpg" alt="">
<span class="title">可菱水(CLEANSUI) 净水器家用 台上式可清洗直饮净水机厨房水龙头过滤器 日本原装进口净水器 三菱净水器Q602典雅红(双芯标配装)</span>
<p class="price"><span>¥</span><span class="old-p">1400</span>.00</p>
<div class="pinglun"><img src="./img/自营.png" alt=""><div>3000+条评论</div>
<div class="similar">看相似</div></div>
</a></div>
<div class="g-stamp"><a href="#">
<img src="./img/购物车商品8.jpg" alt="">
<span class="title">小鸭牌小冰箱迷你小型家用 冷藏冷冻宿舍寝室出租房用双门办公室电冰箱节能省电 一级能效-42L银【四天约一度电】</span>
<p class="price"><span>¥</span><span class="old-p">308</span>.00</p>
<div class="pinglun"><img src="./img/自营.png" alt=""><div>200+条评论</div>
<div class="similar">看相似</div></div>
</a></div>
<div class="g-stamp"><a href="#">
<img src="./img/购物车商品9.jpg" alt="">
<span class="title">戴森(DYSON)HD15 新一代吹风机 Dyson Supersonic 电吹风 负离子 进口家用 礼物推荐 HD15 紫红色</span>
<p class="price"><span>¥</span><span class="old-p">3299</span>.00</p>
<div class="pinglun">5万+条评论<div class="similar">看相似</div></div>
</a></div>
<div class="g-stamp"><a href="#">
<img src="./img/购物车商品10.jpg" alt="">
<span class="title">小能人(soulor) 汽车应急启动电源12V户外移动充电宝车载电瓶搭电宝备用打火神器 13800mAh升级版+搭电神器</span>
<p class="price"><span>¥</span><span class="old-p">118</span>.00</p>
<div class="pinglun"><img src="./img/自营.png" alt=""><div class="similar">看相似</div></div>
</a></div>
<div class="g-stamp"><a href="#">
<img src="./img/购物车商品11.jpg" alt="">
<span class="title">INSCRIPTION 欧式轻奢碗家用特色餐厅异形金边陶瓷餐具 4.5英寸饭碗(抹茶绿)</span>
<p class="price"><span>¥</span><span class="old-p">13</span>.80</p>
<div class="pinglun"><img src="./img/自营.png" alt=""><div class="similar">看相似</div></div>
</a></div>
<div class="g-stamp"><a href="#">
<img src="./img/购物车商品12.jpg" alt="">
<span class="title">华为HUAWEI手环8 NFC版 活力橙 华为运动手环 智能手环 8.99毫米轻薄设计 心率、血氧、睡眠监测 磁吸快充</span>
<p class="price"><span>¥</span><span class="old-p">279</span>.00</p>
<div class="pinglun"><img src="./img/自营.png" alt=""><div class="similar">看相似</div></div>
</a></div>
</div>
<!-- 底部 -->
<div id="footer">
<a href="index.html">
<img src="./img/首页2.png" alt="">
</a>
<a href="#">
<img src="./img/分类.png" alt="">
</a>
<a href="./购物车.html">
<img src="./img/购物车3.png" alt="">
</a>
<a href="./登录页.html">
<img src="./img/未登录.png" alt="">
</a>
</div>
</body>
CSS:
#top {
width: 100%;
height: 44px;
position: relative;
background-color: #fff;
}
#top a {
position: absolute;
top: 10px;
left: 10px;
}
#top a > img {
width: 24px;
height: 24px;
}
#top > div {
text-align: center;
padding-top: 11px;
font-size: 20px;
}
#top > img {
width: 20px;
position: absolute;
top: 20px;
right: 15px;
}
#dl {
width: 100%;
background-color: #fff;
border-radius: 0px 0px 15px 15px;
margin-top: 2px;
color: #333;
font-size: 14px;
height: 60px;
line-height: 60px;
text-align: center;
}
#dl a {
background-image: linear-gradient(270deg, #f2270c, #ff4b2b);
border-radius: 15px;
box-shadow: 0 3px 6px 0 rgba(255, 65, 66, 0.2);
color: #fff;
display: inline-block;
height: 30px;
line-height: 30px;
margin-left: 10px;
text-align: center;
width: 58px;
}
#middle {
width: 100%;
height: 240px;
padding: 70px 0 65px;
text-align: center;
}
#middle > div {
background: url(img/购物车2.png) no-repeat 50%;
background-size: 90px 90px;
display: inline-block;
height: 90px;
width: 90px;
}
#middle > p {
color: #333;
font-size: 16px;
line-height: 16px;
margin-top: 15px;
}
#middle > img {
padding: 15px 20px 13px 8px;
width: 90%;
height: 74px;
margin-top: 65px;
}
#fjx {
width: 90%;
height: 30px;
display: flex;
}
#fjx div:first-child {
flex: 2 2 auto;
height: 3%;
background-color: #ccc;
margin-top: 10px;
padding-right: 40px;
}
#fjx div:nth-child(2) {
flex: 1 1 auto;
color: #999;
font-size: 12px;
margin-left: 35px;
}
#fjx div:last-child {
flex: 2 2 auto;
height: 3%;
background-color: #ccc;
margin-top: 10px;
padding-left: 40px;
}
#goods {
width: 100%;
margin-top: 20px;
display: flex;
/* 换行 */
flex-wrap: wrap;
justify-content: space-evenly;
box-sizing: border-box;
margin-bottom: 42px;
}
#goods .g-stamp {
width: 48%;
min-height: 250px;
box-sizing: border-box;
background: #fff;
margin-bottom: 15px;
border-radius: 15px;
margin-left: 3px;
margin-right: 3px;
}
#goods .g-stamp > a > img {
width: 100%;
border-radius: 10px 10px 0px 0px;
}
#goods .g-stamp .title {
width: 90%;
min-height: 30px;
font-size: 14px;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
margin-top: 5px;
color: #434343;
margin-left: 10px;
}
#goods .g-stamp .pricemin {
display: inline-block;
margin-top: 2px;
font-size: 12px;
color: #ff3090;
background-color: #fff7ef;
margin-left: 10px;
}
#goods .g-stamp .price {
margin-top: 6px;
font-size: 14px;
color: #ff4142;
margin-left: 10px;
}
#goods .g-stamp .price .old-p {
font-size: 20px;
}
#goods .g-stamp .pinglun {
color: #999;
font-size: 12px;
margin-left: 10px;
position: relative;
margin-top: -1px;
margin-bottom: 12px;
}
#goods .g-stamp .pinglun img {
align-items: center;
width: 24px;
margin-top: 8px;
}
#goods .g-stamp .pinglun .similar {
display: inline-block;
background-color: #f2f2f2;
color: #000;
font-size: 12px;
margin-top: 5px;
margin-bottom: 8px;
border-radius: 8px;
padding-right: 8px;
padding-left: 8px;
text-align: right;
position: absolute;
right: 10px;
bottom: -9px;
}
#footer {
width: 100%;
height: 42px;
background-color: #fff;
box-shadow: 0 0 10px 0 hsla(0, 6%, 58%, 0.6);
position: fixed;
bottom: 0;
display: flex;
z-index: 10;
}
#footer a {
width: 25%;
justify-content: space-around;
display: flex;
}
#footer a img {
align-items: center;
width: 55px;
}
LESS:
// 头部
#top{
width: 100%;
height: 44px;
background-color: #fff;
position: relative;
background-color: #fff;
a{
position: absolute;
top: 10px;
left: 10px;
>img{
width: 24px;
height: 24px;
}
}
>div{
text-align: center;
padding-top: 11px;
font-size: 20px;
}
>img{
width: 20px;
position: absolute;
top: 20px;
right: 15px;
}
}
// 登录
#dl{
width: 100%;
height: 60px;
background-color: #fff;
border-radius: 0px 0px 15px 15px;
margin-top: 2px;
color: #333;
font-size: 14px;
height: 60px;
line-height: 60px;
text-align: center;
a{
background-image: linear-gradient(270deg,#f2270c,#ff4b2b);
border-radius: 15px;
box-shadow: 0 3px 6px 0 rgba(255,65,66,.2);
color: #fff;
display: inline-block;
height: 30px;
line-height: 30px;
margin-left: 10px;
text-align: center;
width: 58px;
}
}
// 中间部分
#middle{
width: 100%;
height: 240px;
padding: 70px 0 65px;
text-align: center;
>div{
background: url(./img/购物车2.png) no-repeat 50%;
background-size: 90px 90px;
display: inline-block;
height: 90px;
width: 90px;
}
>p{
color: #333;
font-size: 16px;
line-height: 16px;
margin-top: 15px;
}
>img{
padding: 15px 20px 13px 8px;
width: 90%;
height: 74px;
margin-top: 65px;
}
}
// 分界线
#fjx{
width: 90%;
height: 30px;
display: flex;
div:first-child{
flex: 2 2 auto;
height: 3%;
background-color: #ccc;
margin-top: 10px;
padding-right: 40px;
}
div:nth-child(2){
flex: 1 1 auto;
color: #999;
font-size: 12px;
margin-left: 35px;
}
div:last-child{
flex: 2 2 auto;
height: 3%;
background-color: #ccc;
margin-top: 10px;
padding-left: 40px;
}
}
// 商品推荐
#goods{
width: 100%;
margin-top: 20px;
display: flex;
/* 换行 */
flex-wrap: wrap;
justify-content: space-evenly;
box-sizing: border-box;
margin-bottom: 42px;
.g-stamp{
width: 48%;
min-height: 250px;
box-sizing: border-box;
background: #fff;
margin-bottom: 15px;
border-radius: 15px;
margin-left: 3px;
margin-right: 3px;
>a>img{
width: 100%;
border-radius: 10px 10px 0px 0px;
}
.title{
width: 90%;
min-height: 30px;
font-size: 14px;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
margin-top: 5px;
color:#434343;
margin-left: 10px;
}
.pricemin{
display: inline-block;
margin-top: 2px;
font-size: 12px;
color: rgb(255,48,144);
background-color: #fff7ef;
margin-left: 10px;
}
.price{
margin-top: 6px;
font-size: 14px;
color: #ff4142;
margin-left: 10px;
.old-p{
font-size: 20px;
}
}
.pinglun{
color: #999;
font-size: 12px;
margin-left: 10px;
position: relative;
margin-top: -1px;
margin-bottom: 12px;
img{
align-items: center;
width: 24px;
margin-top: 8px;
}
.similar{
display: inline-block;
background-color: #f2f2f2;
color: #000;
font-size: 12px;
margin-top: 5px;
margin-bottom: 8px;
border-radius: 8px;
padding-right: 8px;
padding-left: 8px;
text-align: right;
position: absolute;
right: 10px;
bottom: -9px;
}
}
}
}
// 底部
#footer{
width: 100%;
height: 42px;
background-color: #fff;
box-shadow: 0 0 10px 0 hsl(0deg 6% 58% / 60%);
position: fixed;
bottom: 0;
display: flex;
z-index: 10;
a{
width: 25%;
justify-content: space-around;
display: flex;
img{
align-items: center;
width: 55px;
}
}
}
4、登录页面
HTML:
<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">
<title>京东登录注册</title>
<link rel="stylesheet" href="./登录页.css">
</head>
<body>
<!-- 头部 -->
<div id="top">
<a href="./index.html"><img src="./img/向左箭头.png" alt=""></a>
<div>京东登录注册</div>
</div>
<!-- 中间 -->
<div id="middle">
<div>
<span>+86</span>
<img src="./img/向下箭头.png" alt="">
<input type="tel" placeholder="请输入手机号" report-eventid="MLoginRegister_SMSPhoneInput" autofocus>
</div>
<div>
<input type="tel" placeholder="请输入收到的验证码" report-eventid="MLoginRegister_SMSPhoneInput" autofocus>
<span>获取验证码</span>
</div>
<div><span>登录</span></div>
<div>
<span class="m-1">账号密码登录</span>
<span class="m-2">手机快速注册</span>
</div>
</div>
<!-- 底部 -->
<div id="bottom">
<span class="b-1">其他登录方式</span>
<span><img src="./img/QQ.png" alt="">
<img src="./img/微信.png" alt="">
<img src="./img/苹果.png" alt=""></span><br>
<input type="checkbox"><span class="b-2">若您输入的手机号未注册,将为您直接注册,注册即视为同意 <a>京东用户注册协议</a>、<a>用户隐私政策</a></span>
</div>
</body>
CSS:
#top {
width: 100%;
height: 44px;
position: relative;
background-color: #fff;
}
#top a {
position: absolute;
top: 10px;
left: 10px;
}
#top a > img {
width: 24px;
height: 24px;
}
#top > div {
text-align: center;
padding-top: 11px;
font-size: 20px;
}
#middle {
width: 100%;
height: 280px;
background-color: #fff;
}
#middle > div:first-child {
width: 80%;
height: 50px;
font-size: 18px;
text-align: center;
position: relative;
border-bottom: 0.01rem solid #efefef;
padding-bottom: 20px;
margin-left: 33px;
}
#middle > div:first-child span {
position: absolute;
top: 30px;
left: 15px;
}
#middle > div:first-child img {
width: 14px;
height: 6px;
position: absolute;
top: 38px;
left: 53px;
}
#middle > div:first-child input {
border: 0;
font-size: 16px;
position: absolute;
top: 30px;
left: 70px;
border: 0px;
outline: none;
}
#middle > div:nth-child(2) {
width: 80%;
height: 50px;
font-size: 18px;
position: relative;
border-bottom: 0.01rem solid #efefef;
padding-bottom: 20px;
margin-left: 33px;
}
#middle > div:nth-child(2) input {
border: 0;
font-size: 16px;
position: absolute;
top: 30px;
left: 4px;
border: 0px;
outline: none;
}
#middle > div:nth-child(2) span {
font-size: 16px;
border-left: 1px solid #ccc;
color: #848689;
position: absolute;
top: 30px;
right: 4px;
padding-left: 10px;
}
#middle > div:nth-child(3) {
width: 80%;
height: 50px;
position: relative;
text-align: center;
}
#middle > div:nth-child(3) span {
width: 100%;
position: absolute;
top: 30px;
left: 8%;
background-image: linear-gradient(90deg, #fab3b3, #ffbcb3 73%, #ffcaba);
color: #fff;
border-radius: 20px;
padding: 15px;
display: block;
font-size: 16px;
}
#middle > div:last-child {
width: 80%;
height: 20px;
position: relative;
font-size: 14px;
color: rgba(0, 0, 0, 0.4);
}
#middle > div:last-child .m-1 {
position: absolute;
top: 50px;
left: 24px;
}
#middle > div:last-child .m-2 {
position: absolute;
top: 50px;
right: -50px;
}
#bottom {
width: 90%;
height: 100px;
background-color: #fff;
border-top: 1px solid rgba(0, 0, 0, 0.1);
margin: auto;
margin-top: 58px;
position: relative;
}
#bottom .b-1 {
color: rgba(0, 0, 0, 0.2);
width: 95px;
background: #fff;
text-align: center;
font-size: 12px;
position: absolute;
top: -8px;
left: 35%;
}
#bottom img {
width: 48px;
height: 48px;
margin: 0 10px;
padding-top: 25px;
padding-left: 20px;
padding-bottom: 20px;
}
#bottom .b-2 {
font-size: 12px;
color: rgba(0, 0, 0, 0.3);
}
#bottom .b-2 a {
color: #4a90e2;
text-decoration: none;
}
LESS:
// 头部
#top{
width: 100%;
height: 44px;
position: relative;
background-color: #fff;
a{
position: absolute;
top: 10px;
left: 10px;
>img{
width: 24px;
height: 24px;
}
}
>div{
text-align: center;
padding-top: 11px;
font-size: 20px;
}
}
// 中间
#middle{
width: 100%;
height: 280px;
background-color: #fff;
>div:first-child{
width: 80%;
height: 50px;
font-size: 18px;
text-align: center;
position: relative;
border-bottom: 0.01rem solid #efefef;
padding-bottom: 20px;
margin-left: 33px;
span{
position: absolute;
top: 30px;
left: 15px;
}
img{
width: 14px;
height: 6px;
position: absolute;
top: 38px;
left: 53px;
}
input{
border: 0;
font-size: 16px;
position: absolute;
top: 30px;
left: 70px;
border: 0px;
outline: none;
}
}
>div:nth-child(2){
width: 80%;
height: 50px;
font-size: 18px;
position: relative;
border-bottom: 0.01rem solid #efefef;
padding-bottom: 20px;
margin-left: 33px;
input{
border: 0;
font-size: 16px;
position: absolute;
top: 30px;
left: 4px;
border: 0px;
outline: none;
}
span{
font-size: 16px;
border-left: 1px solid #ccc;
color: #848689;
position: absolute;
top: 30px;
right: 4px;
padding-left: 10px;
}
}
>div:nth-child(3){
width: 80%;
height: 50px;
position: relative;
text-align: center;
span{
width: 100%;
position: absolute;
top: 30px;
left: 8%;
background-image: linear-gradient(90deg,#fab3b3,#ffbcb3 73%,#ffcaba);
color: #fff;
border-radius: 20px;
padding: 15px;
display: block;
font-size: 16px;
}
}
>div:last-child{
width: 80%;
height: 20px;
position: relative;
font-size: 14px;
color: rgba(0,0,0,.4);
.m-1{
position: absolute;
top: 50px;
left: 24px;
}
.m-2{
position: absolute;
top: 50px;
right: -50px;
}
}
}
// 底部
#bottom{
width: 90%;
height: 100px;
background-color: #fff;
border-top: 1px solid rgba(0,0,0,.1);
margin: auto;
margin-top: 58px;
position: relative;
.b-1{
color: rgba(0,0,0,.2);
width: 95px;
background: #fff;
text-align: center;
font-size: 12px;
position: absolute;
top: -8px;
left: 35%;
}
img{
width: 48px;
height: 48px;
margin: 0 10px;
padding-top: 25px;
padding-left: 20px;
padding-bottom: 20px;
}
.b-2{
font-size: 12px;
color: rgba(0,0,0,.3);
a{
color: #4a90e2;
text-decoration: none;
}
}
}
三、总结
这次主要是运用HTML和CSS进行设计,其中轮播图的部分运用了JS,为了节省时间,这次还用了less分担了一部分css,使代码更加简洁。