以上是设计图。
以下是对应的css.
.box-contain{
width: 650px;
height: 1009px;
color: #FFF;
font-size: 24px;
text-align: center;
line-height: 60px;
background-color: #FFF;
position: relative;
z-index: 100;
margin: auto;
z-index: 100;
border-radius: 20px;
}
.box-contain::after{
width: 40px;
height: 40px;
content: "";
right: -20px;
top: 629px;
position: absolute;
display: block;
background: #F3F3F3;
border-radius: 40px;
}
.box-contain::before{
width: 40px;
height: 40px;
content: "";
left: -20px;
top: 629px;
position: absolute;
display: block;
background: #F3F3F3;
border-radius: 40px;
}
虚线样式:
.bottom-box{
width:650px;
height:379px;
background: #fff;
position: relative;
border-radius: 0 0 8px 8px;
margin: 40px auto;
padding: 40px;
text-align: left;
.gift {
font-size: 24px;
color: #141313;
font-weight: bold;
line-height: 33px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
span {
color: #FF3B50;
}
}
.desc {
margin: 20px auto;
font-size: 26px;
color: #666666;
line-height: 37px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
.time-label {
margin: 10px auto;
font-size: 26px;
color: #666666;
line-height: 37px;
}
.time {
margin: 10px auto;
font-size: 26px;
color: #666666;
line-height: 37px;
}
}
.top-box p,.bottom-box p{
width: calc(650px - 40px);
height:20px;
position:absolute;
left: 20px;
}
.top-box p{
background: #fff;
bottom: -20px;
border-bottom: 4px dashed #E1E1E1;
}
.bottom-box p{
background: #fff;
top: -20px;
}
.top-box p::before,.bottom-box p::before{
content:'';
position:absolute;
width: 20px;
height: 20px;
left:-20px;
}
.top-box p::after,.bottom-box p::after{
content:'';
position:absolute;
width: 20px;
height: 20px;
right:-20px;
// background: #FFF;
border-radius: 100%;
}
页面代码:
<div class="box-contain">
<div class="top-box">
</div>
</div>
<p></p>
<div class="bottom-box">
<p></p>
</div>