注:
1.背景灰色
2.优惠券有阴影,但缺口处阴影也需要缺口。希望阴影和圆角css可控。
3.希望中线位置css可控。
求:
最优切图及CSS方案。
用两层div,一层用来给灰色做背景,然后通过padding填充,里面那个div在设置白色背景,另外两个点可以用伪类定位,或者用两个i标签定位,虚线那个就不用说了吧…大概就这样的思路。
li{
list-style: none;
}
.bg-color{
position: relative;
width: 760px;
height: 210px;
background: #eeeeee;
display: flex;
justify-content: center;
align-items: center;
}
.bg-color .box{
width: 710px;
height: 175px;
background: #fff;
border-radius: 8px;
box-shadow: -2px 2px 2px #ccc;
display: flex;
align-items: center;
justify-content: space-between;
position: relative;
}
.sheep::before{
content: '';
width: 16px;
height: 8px;
background-color:#eeeeee;
z-index: 1;
border-radius: 0 0 8px 8px;
position: absolute;
border-bottom:none;
top: 0px;
left: 0;
left: -8px
}
.sheep:after{
content: '';
width: 16px;
height: 12px;
z-index: 1;
background: #eeeeee;
border-radius: 12px 12px 0 0;
position: absolute;
border-bottom:none;
bottom: -4px;
left: -8px;
}
.box .box-l{
padding: 0 30px;
}
.box .title{
font-size: 35px;
font-weight: bold;
padding-bottom: 20px;
}
.box .time{
font-size: 18px;
color: #9E9E9E;
}
.box .money{
color: red;
font-size: 25px;
padding-bottom: 20px;
}
.box .discount{
color: red;
font-size: 25px;
}
.box .box-r{
text-align: center;;
padding: 0 30px;
}
.sheep{
height: inherit;
border-left: 2px dashed #eee;
position: absolute;
left: 510px;
}
<div class="bg-color">
<div class="box">
<ul class="box-l">
<li class="title">满减优惠券</li>
<li class="time">有效期至:2018-01-01</li>
</ul>
<div class="sheep"></div>
<ul class="box-r">
<li class="money">¥55</li>
<li class="discount">满1000元减</li>
</ul>
</div>
</div>
4 回答1k 阅读✓ 已解决
2 回答1.5k 阅读✓ 已解决
3 回答1.3k 阅读✓ 已解决
1 回答912 阅读✓ 已解决
1 回答724 阅读✓ 已解决
3 回答753 阅读
2 回答926 阅读
大概实现了一下,水平有限

效果
css部分
html部分