如果考虑到节省带宽,不想使用背景图片,则可以使用以下方案,该方案兼容ios和安卓,我最开始用 border-right: 8px dotted #eff1f4;实现中国效果,结果ios不兼容,(垃圾苹果啊~~~~~~~~~~)
效果图:可以只要一边的齿轮····
![K0TOVTWE$]O6R~FV]RH}VV.png
<view class="coupon coupon-wave-left coupon-wave-right coupon-yellow"> </view>
.coupon {
position: relative;
height: 200rpx;
width: 730rpx;
margin: 0 auto;
overflow: hidden;
}
/* 优惠券背景颜色 */
.coupon-yellow {
background-color: #f39b00;
}
/* 左边框的波浪 */
.coupon-wave-left::before, .coupon-wave-right::after {
content: '';
position: absolute;
top: 50%;
margin-top: -90rpx;
height: 90%;
width: 28rpx;
background-image: radial-gradient(#eff1f4 0, #eff1f4 8rpx, transparent 8rpx);
background-size: 28rpx 28rpx;
background-position: center center;
z-index: 1;
}
.coupon-wave-left::before {
left: -11rpx;
}
.coupon-wave-left::after {
left: -11rpx;
}
网友评论