太平洋保险官网项目实践(三)
文章目录
太平洋保险官网项目实践(三)实现目标一、第一部分1.大体布局(1)html(2)css
2.上部分细节布局(1)html(2)css
3.下部分细节布局(1)html(2)css
二、第二部分1.大体布局(1)html(2)css
2.内容细节布局(1)html(2)css
实现目标
今日实现目标:轮播图后第一二部分。 具体效果如下图所示 第一部分第二部分
以下是本篇文章正文内容,下面案例可供参考
一、第一部分
1.大体布局
(1)html
第一部分主要分为上下两部分,分别命名为r_up,r_dowm
<div class="recommend">
<div class="r_up"></div>
<div class="r_down"></div>
</div>
(2)css
.recommend{
width: 100%
;
height: 800px
;
padding-top: 35px
;
}
.recommend .r_up{
width: 1148px
;
height: 128px
;
margin: 0 auto
;
}
.recommend .r_down{
height: 650px
;
background-image: url('../image/intelligenceBG.png');
background-size: cover
;
}
2.上部分细节布局
(1)html
上部分主要是标题,分为两部分内容
<div class="r_up">
<div><img src="../image/tj3Til.png" alt=""></div>
<ul>
<li>智能推荐
<i></i>
</li>
<li>为自己
</li>
<li>为子女
</li>
<li>为父母
</li>
<a href="#">查看更多>
</a>
</ul>
</div>
(2)css
.recommend .r_up div{
margin: 0 auto
;
width: 499px
;
height: 38px
;
}
.recommend .r_up div img{
width: 499px
;
height: 38px
;
margin: 0 auto
;
}
.recommend .r_up ul{
width: 1148px
;
height: 54px
;
padding: 0 0 0 56px
;
margin: 36px 0 0 0
;
}
.recommend .r_up ul li{
display: inline-block
;
height: 54px
;
margin-right: 180px
;
font-size: 18px
;
font-weight: 600
;
line-height: 40px
;
}
.recommend .r_up ul>li:nth-child(1){
color: #1565c0
;
}
.recommend .r_up ul>li:nth-child(1) i{
background-image: url('../image/tabActive.png');
background-size: cover
;
width: 100%
;
height: 5px
;
display: block
;
margin-top: 12px
;
}
.recommend .r_up ul a{
font-size: 18px
;
color: #909090
;
text-decoration: none
;
font-weight: 100
;
}
3.下部分细节布局
(1)html
下部分主要是六个卡片,2*3分布
<div class="r_down">
<div>
<ul>
<li>
<div><img src="../image/tag_zjx.png"></div>
<div>
<div class="product_left">
<a href="../html/jinfu_life.html" style="float: left; height: 38px;"><h3>金福人生保险产品计划
</h3></a>
<p class="p1">105种重疾|轻症三次赔|少儿特定疾病
</p>
<div>
<span><i class="iconfont icon-checked"></i>身故/全残
</span>
<span><i class="iconfont icon-checked"></i>重疾轻症
</span>
<span><i class="iconfont icon-checked"></i>少儿特定疾病
</span>
</div>
<p class="p2">承保年龄:30天-17周岁
</p>
<div>
<span class="wenzi">
<span>¥
</span>
<span>2000
</span>
<span>起
</span>
</span>
<a href="#" class="a1">立即投保
<i class="iconfont icon-zuojiantou"></i></a>
</div>
</div>
<div class="product_right">
<img src="../image/95a97c7c-212a-46c8-a6f7-9c7e1f745dbf.png">
</div>
</div>
</li>
</ul>
</div>
</div>
(2)css
.recommend .r_down>div{
width: 1148px
;
height: 632px
;
margin: 0 auto
;
}
.recommend .r_down>div ul{
width: 1140px
;
height: 632px
;
padding: 23px 0 0 0
;
margin: 0 auto
;
}
.recommend .r_down>div ul li{
display: block
;
float: left
;
position: relative
;
width: 555px
;
height: 183px
;
border: 2px solid #e7e7e7
;
border-radius: 4px
;
box-shadow: 0 5px 8px 0 #e7e7e7
;
background-color: white
;
}
.recommend .r_down>div ul li:hover{
border:2px solid #1565c0
;
}
.recommend .r_down>div ul li:nth-child(2n+1){
margin: 0 21px 21px 0
;
}
.recommend .r_down>div ul li:nth-child(2n){
margin: 0 0 21px 0
;
}
.recommend .r_down>div ul li div:nth-child(1){
width: 78px
;
height: 31px
;
margin-left: 480px
;
position: absolute
;
z-index: 2
;
}
.recommend .r_down>div ul li div:nth-child(2){
width: 530px
;
height: 160px
;
margin: 0 auto
;
padding-top: 15px
;
}
.recommend .r_down>div ul li img{
width: 78px
;
height: 31px
;
}
.recommend .r_down>div ul li div:nth-child(2) .product_left{
width: 330px
;
height: 154px
;
margin: 0 0 0 15px
;
float: left
;
}
.recommend .r_down>div ul li div:nth-child(2) .product_left h3{
font-size: 20px
;
color: #262626
;
line-height: 24px
;
margin: 8px 0 0 0
;
width: 300px
;
font-weight: 600
;
letter-spacing: 2px
;
}
.recommend .r_down>div ul li div:nth-child(2) .product_left h3:hover{
color: #1565c0
;
}
.recommend .r_down>div ul li div:nth-child(2) .product_left .p1{
font-size: 15px
;
color: #333333
;
line-height: 20px
;
margin: 4px 0 5px 0
;
font-weight: 100
;
}
.recommend .r_down>div ul li div:nth-child(2) .product_left>div:nth-child(1){
width: 335px
;
height: 20px
;
margin-top: 10px
;
}
.recommend .r_down>div ul li div:nth-child(2) .product_left div span{
font-size: 13px
;
color: #9f9f9f
;
line-height: 20px
;
margin: 0 19px 0 0
;
font-weight: 100
;
}
.recommend .r_down>div ul li div:nth-child(2) .product_left .p2{
font-size: 13px
;
color: #9f9f9f
;
line-height: 20px
;
margin: 6px 0 15px 0
;
}
.recommend .r_down>div ul li div:nth-child(2) .product_left .wenzi{
width: 91px
;
height: 23px
;
}
.recommend .r_down>div ul li div:nth-child(2) .product_left .wenzi span{
color: #e93e4e
;
margin: 0
;
}
.recommend .r_down>div ul li div:nth-child(2) .product_left .wenzi>span:nth-child(1){
font-size: 18px
;
font-weight: 600
;
}
.recommend .r_down>div ul li div:nth-child(2) .product_left .wenzi>span:nth-child(2){
font-size: 28px
;
font-weight: 600
;
}
.recommend .r_down>div ul li div:nth-child(2) .product_left .wenzi>span:nth-child(3){
font-size: 16px
;
font-weight: 600
;
}
.recommend .r_down>div ul li div:nth-child(2) .product_left a{
font-size: 15px
;
display: block
;
float: right
;
text-decoration: none
;
color: #333333
;
font-weight: 600
;
margin-right: 30px
;
}
.recommend .r_down>div ul li div:nth-child(2) .product_left .a1{
width: 100px
;
height: 25px
;
text-align: center
;
line-height: 25px
;
margin-bottom: 10px
;
position: relative
;
}
.recommend .r_down>div ul li:hover>div:nth-child(2) .product_left .a1{
border:1px solid #0d5bc7
;
border-radius: 30px
;
color: white
;
background-color: #1565c0
;
}
.recommend .r_down>div ul li div:nth-child(2) .product_right{
width: 170px
;
height: 158px
;
border-radius: 5px
;
position: relative
;
float: right
;
padding: 0
;
}
.recommend .r_down>div ul li div:nth-child(2) .product_right img{
width: 170px
;
height: 158px
;
border-radius: 5px
;
transition: all 1s
;
}
.recommend .r_down>div ul li:hover>div .product_right img{
transform: scale(1.05
);
}
二、第二部分
1.大体布局
(1)html
第一部分主要分为上下两部分,分别为标题及内容
<div class="explore">
<div class="main">
<p>探索优质保险
</p>
<div>
<p class="text">精选热销产品
</p>
<span>绝不错过的质量产品
</span>
<h4>寻找适合我的保险>
</h4>
</div>
<div id="main"></div>
</div>
</div>
(2)css
.explore{
width: 100%
;
height: 550px
;
padding-top: 20px
;
}
.explore .main{
width: 1148px
;
height: 542.4px
;
margin: 0 auto
;
}
.explore .main>p{
text-align: center
;
font-size: 45px
;
margin: 0
;
}
.main>div{
height: 30px
;
}
.explore .main .text{
font-size: 18px
;
width: 120px
;
float: left
;
margin: 0
;
}
.explore .main span{
font-size: 16px
;
color: #4a4a4a
;
float: left
;
margin-top: 4px
;
}
.explore .main h4{
font-size: 16px
;
color: #1565c0
;
float: right
;
font-weight: inherit
;
margin: 0
;
}
2.内容细节布局
(1)html
内容主要分为左中右三部分,分别为main_left,main_center,main_right
<div id="main">
<div class="main_left">
<div class="picture">
<i class="iconfont icon-zuojiantou"></i>
<p>车险计算器
</p>
</div>
<form>
<div>
<label>行驶城市
</label>
<input type="text" placeholder="请选择">
</div>
<div style="font-size: 12px;">
<label>车牌号码
</label>
<input type="text" placeholder="请输入您的车牌号" id="l1">
<input type="checkbox">新车未上牌
</div>
<div>
<label>车主生日
</label>
<input type="text" placeholder="格式如:0816">
</div>
<div>
<label>手机号码
</label>
<input type="text" placeholder="输入您的手机号">
</div>
<input type="submit" value="立即投保">
</form>
</div>
<div class="main_center">
<div class="up">
<div>爆款推荐
</div>
</div>
<div class="down">
<p>学校不再代办意外险,少儿意外不可忽视
</p>
<p>涵盖意外身故、伤残 意外医疗 重大疾病
</p>
</div>
<span>阅读更多
</span>
</div>
<div class="main_right">
<div></div>
<div>
<p>意外身故、伤残最高50万
</p>
<p>交通意外最高500万
</p>
<p>扩展高风险运动最高50万 最低65元起
</p>
</div>
<span>阅读更多
</span>
</div>
</div>
(2)css
#main{
width: 1148px
;
height: 440px
;
}
#main .main_left{
margin-top: 45px
;
width: 338.4px
;
height: 368px
;
border: 1px solid #e0e0e0
;
border-radius: 5px
;
box-shadow: 0 6px 11px 0px #e0e0e0
;
float: left
;
}
#main .main_left .picture{
width: 338.4px
;
height: 100px
;
background-image: url('../image/cat_topBg.jpg');
background-size: cover
;
background-position: center
;
border-radius: 5px 5px 0 0
;
}
#main .main_left .picture i{
color: white
;
font-size: 20px
;
padding: 12px 0 0 310px
;
position: absolute
;
}
#main .main_left .picture p{
margin: 0
;
font-size: 24px
;
color: white
;
margin: 40px 0 0 100px
;
position: absolute
;
}
#main .main_left form{
margin-left: 20px
;
}
#main .main_left form div{
width: 100%
;
margin: 15px 0
;
overflow: hidden
;
}
#main .main_left form label{
font-size: 12px
;
color: #4a4a4a
;
display: inline-block
;
height: 26px
;
line-height: 26px
;
}
#main .main_left form input{
background-color: #f3f7fa
;
line-height: 26px
;
border: none
;
font-size: 12px
;
color: #4a4a4a
;
width: 230px
;
}
#main .main_left form div #l1{
width: 147px
;
}
#main .main_left form input[type=checkbox]{
width: 10px
;
display: inline-block
;
vertical-align: middle
;
margin-top: 2px
;
}
#main .main_left form>input{
width: 220px
;
height: 40px
;
font-size: 16px
;
color: white
;
background-color: #1565c0
;
border-radius: 25px
;
letter-spacing: 2px
;
margin: 20px 0 0 40px
;
}
#main .main_center{
width: 420px
;
height: 368px
;
margin: 45px 33px
;
border: 1px solid #e6e6e6
;
border-radius: 5px
;
float: left
;
position: relative
;
box-shadow: 0 6px 11px 0px #e0e0e0
;
}
#main .main_center .up{
width: 420px
;
height: 171px
;
background-image: url('../image/tsyzbx_RWX.jpg');
background-size: cover
;
border-radius: 5px 5px 0 0
;
}
#main .main_center .up div{
width: 76px
;
height: 22px
;
font-size: 14px
;
color: white
;
background-color: #379d6a
;
border-radius: 5px
;
text-align: center
;
margin: 20px 0 0 20px
;
position: absolute
;
}
#main .main_center .down,#main .main_right>div:nth-child(2){
width: 300px
;
height: 60px
;
padding: 50px 20px
;
}
#main .main_center .down p,#main .main_right p{
font-size: 14px
;
color: #7a7a7a
;
margin: 0
;
}
#main .main_center span,#main .main_right span{
font-size: 14px
;
color: #1565c0
;
float: right
;
margin: 0 30px 20px 0
;
}
#main .main_right{
position: relative
;
float: right
;
width: 316px
;
height: 368px
;
border: 1px solid #e6e6e6
;
border-radius: 5px
;
margin-top: 45px
;
box-shadow: 0 6px 11px 0px #e0e0e0
;
}
#main .main_right>div:nth-child(1){
width: 316px
;
height: 170px
;
background-image: url('../image/tsyzbx_BK2.png');
background-size: cover
;
border-radius: 5px 5px 0 0
;
}
#main>div:hover{
box-shadow: 0 15px 25px 0px #d1d1d1
;
}
今日结束,明日预告:三个部分