本次是仿京东中上部
效果图:
html代码:
<!-- 中间区域 start -->
<div class="w grid">
<!-- 分类 -->
<div class="grid-col1 fl">
<ul>
<li><a href="#">家用电器</a></li>
<li><a href="#">手机</a>/<a href="#">运营商</a>/<a href="#">数码</a></li>
<li><a href="#">电脑</a>/<a href="#">办公</a></li>
<li><a href="#">家居</a>/<a href="#">家具</a>/<a href="#">家装</a>/<a href="#">厨具</a></li>
<li><a href="#">男装</a>/<a href="#">女装</a>/<a href="#">童装</a>/<a href="#">内衣</a></li>
<li><a href="#">美妆</a>/<a href="#">个护清理</a>/<a href="#">宠物</a></li>
<li><a href="#">女鞋</a>/<a href="#">箱包</a>/<a href="#">钟表</a>/<a href="#">珠宝</a></li>
<li><a href="#">男鞋</a>/<a href="#">运动</a>/<a href="#">户外</a></li>
<li><a href="#">房产</a>/<a href="#">汽车</a>/<a href="#">汽车用品</a></li>
<li><a href="#">母婴</a>/<a href="#">玩具乐器</a></li>
<li><a href="#">食品</a>/<a href="#">酒类</a>/<a href="#">生鲜</a>/<a href="#">特产</a></li>
<li><a href="#">艺术</a>/<a href="#">礼品鲜花</a>/<a href="#">农资绿植</a></li>
<li><a href="#">医药保健</a>/<a href="#">计生情趣</a></li>
<li><a href="#">图书</a>/<a href="#">文娱</a>/<a href="#">教育</a>/<a href="#">电子书</a></li>
<li><a href="#">机票</a>/<a href="#">酒店</a>/<a href="#">旅游</a>/<a href="#">生活</a></li>
<li><a href="#">理财</a>/<a href="#">众筹</a>/<a href="#">白条</a>/<a href="#">保险</a></li>
<li><a href="#">安装</a>/<a href="#">维修</a>/<a href="#">清洗</a>/<a href="#">二手</a></li>
<li><a href="#">工业品</a></li>
</ul>
</div>
<!-- banner部分 -->
<div class="grid-col2 fl">
<div class="grid-col2-l">
<a href="#"><img src="../images/banner.png" height="470px" width="590px"></a>
<div class="arrow-l"><span class="icon-circle-left"></span></div>
<div class="arrow-r"><span class="icon-circle-right"></span></div>
<div class="circle">
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
</div>
<div class="grid-col2-r">
<div class="grid-col2-r1">
<img src="../images/banner-r1.png" width="190px" height="150px" >
</div>
<div class="grid-col2-r2">
<img src="../images/banner-r2.png" width="190px" height="150px" >
</div>
<div class="grid-col2-r3">
<img src="../images/banner-r3.png" width="190px" height="150px" >
</div>
</div>
</div>
<div class="grid-col3 fr">
<!-- 登录模块 -->
<div class="login">
<div class="login-t">
<a href="#">Hi~欢迎逛京东!</a><br>
<a href="#">登录</a> | <a href="#">注册</a>
<a href="#" class="user-info">
<img src="../images/user-info.png" width="40px" height="40px">
</a>
</div>
<div class="login-b">
<a href="#">新人福利</a>
<a href="#">PLUS会员</a>
</div>
</div>
<div class="news">
<div class="news-t">
<h5>京东快报</h5>
<a href="#">更多<span class="icon-circle-right"></span></a>
</div>
<div class="news-m">
<ul>
<li><a href="#"><span>推荐</span>华为P40曝光,麒麟990+5000毫安,首款鸿蒙手机</a></li>
<li><a href="#"><span>HOT</span>iPhone Xs被下架!售价便宜近一半,网友却不买账</a></li>
<li><a href="#"><span>HOT</span>iPhone Xs Max便宜近半,256G性价比太高</a></li>
<li><a href="#"><span>HOT</span>iPhone SE2来了!5.5英寸+A13,售价感人</a></li>
</ul>
</div>
</div>
<div class="expand">
<ul>
<li><a href="#"><span class="icon-mobile2 red blue"></span><span>话费</span></a></li>
<li><a href="#"><span class="icon-airplane orange"></span><span>机票</span></a></li>
<li><a href="#"><span class="icon-office green"></span><span>酒店</span></a></li>
<li><a href="#"><span class="icon-pacman orange"></span><span>游戏</span></a></li>
<li><a href="#"><span class="icon-droplet green"></span><span>加油卡</span></a></li>
<li><a href="#"><span class="icon-road red-orange"></span><span>火车票</span></a></li>
<li><a href="#"><span class="icon-users green"></span><span>众筹</span></a></li>
<li><a href="#"><span class="icon-coin-yen blue"></span><span>理财</span></a></li>
<li><a href="#"><span class="icon-file-empty red-orange"></span><span>白条</span></a></li>
<li><a href="#"><span class="icon-video-camera red-orange"></span><span>电影票</span></a></li>
<li><a href="#"><span class="icon-library blue"></span><span>企业购</span></a></li>
<li><a href="#"><span class="icon-credit-card orange"></span><span>礼品卡</span></a></li>
</ul>
</div>
</div>
</div>
<!-- 中间区域 end -->
css代码:
.blue {
color: #439ee1;
}
.orange {
color: #f2a132;
}
.green {
color: #3ad5c5;
}
.red-orange {
color: #e8554b;
}
/* 中间分类模块 */
.grid {
height: 470px;
margin-top: 10px;
}
.grid-col1 {
width: 190px;
height: 100%;
margin-right: 10px;
color: #52423b;
font-size: 14px;
line-height: 25px;
background-color: #fefefe;
}
.grid-col1 ul {
padding: 10px 0;
}
.grid-col1 a {
color: #52423b;
margin: 0 1px;
}
.grid-col1 a:hover {
color: #f10216;
}
.grid-col1 ul li {
padding-left: 17px;
}
.grid-col1 ul li:hover {
background-color: #DEDEDE;
}
/* banner 部分 */
.grid-col2 {
width: 790px;
height: 100%;
margin-right: 10px;
/* position: relative; */
}
/* 轮播图 */
.grid-col2-l {
float: left;
text-align: center;
position: absolute;
overflow: hidden;
}
.circle {
position: absolute;
left: 25px;
bottom: 15px;
}
.circle li {
width: 10px;
height: 10px;
border-radius: 50%;
background-color: rgba(255,255,255,.5);
margin: 3px;
float: left;
background-clip: padding-box;
}
.circle li:first-child {
background-color: #fff;
margin: 1px;
border: 2px solid rgba(255,255,255,.5);
}
.arrow-l,.arrow-r {
height: 35px;
width: 35px;
color: rgba(255,255,255,.6);
font-size: 20px;
background-color: rgba(0,0,0,.2);
line-height: 35px;
position: absolute;
top: 50%;
transform: translateY(-50%);
}
.arrow-l {
left: -10px;
border-radius: 0 50% 50% 0;
}
.arrow-r {
right: -10px;
border-radius: 50% 0 0 50%;
}
.arrow-l:hover,.arrow-r:hover {
background-color: rgba(0,0,0,.3);
}
/* banner 右部分 */
.grid-col2-r {
float: right;
}
.grid-col2-r div {
width: 190px;
height: 150px;
cursor: pointer;
margin-bottom: 10px;
}
.grid-col2-r img {
vertical-align: top;
}
/* 右边部分 */
.grid-col3 {
width: 190px;
height: 100%;
font-size: 12px;
background-color: #fff;
}
.grid-col3 a {
color: #7b7b7b;
}
.grid-col3 a:hover {
color: #E1251B;
}
/* 登录模块 */
.login {
height: 86px;
margin: 14px 20px 0px;
border-bottom: 1px solid #f2f2f2;
position: relative;
}
.login-t {
height: 51px;
line-height: 20px;
padding-left: 55px;
}
.user-info {
width: 40px;
height: 40px;
position: absolute;
top: 0px;
left: 0px;
border-radius: 50%;
border: 2px solid #fff;
overflow: hidden;
box-shadow: 2px 2px 2px #f9f9f9,-2px 2px 2px #f9f9f9;
}
.login-b a{
display: inline-block;
width: 70px;
height: 26px;
font-size: 12px;
font-weight: 500;
line-height: 26px;
text-align: center;
border-radius: 13px;
}
.login-b a:first-child {
color: #fce5e4;
background-color: #e1251b;
}
.login-b a:last-child {
color: #dacd8a;
background-color: #363634;
float: right;
}
.login-b a:hover {
color: #fce5e4;
background-color: #c4241c;
}
/* 新闻模块 */
.news {
height: 130px;
margin: 0px 15px;
border-bottom: 1px solid #f2f2f2;
}
.news-t {
height: 36px;
line-height: 36px;
}
.news-t h5 {
color: #595959;
font-size: 16px;
display: inline-block;
}
.news-t a {
float: right;
color: #b1b1b1;
}
.news-m li {
height: 18px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
margin-bottom: 6px;
}
.news-m span {
width: 35px;
color: #E1251B;
text-align: center;
line-height: 17px;
margin-right: 8px;
background-color: #fdeeed;
display: inline-block;
}
/* 扩展模块 */
.expand li {
height: 59px;
width: 63px;
cursor: pointer;
float: left;
position: relative;
}
.expand span {
display: block;
position: absolute;
left: 50%;
transform: translateX(-50%);
}
.expand span:first-child {
font-weight: 700;
font-size: 20px;
top: 10px;
}
.expand li:hover span{
color: #E1251B;
}
.expand span:last-child {
white-space: nowrap;
bottom: 10px;
}