纯CSS的方式实现优惠券的波浪、内凹圆型的透明锯边效果。

<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
  <style>
  .coupon {
			display: inline-block;
			height: 88px;
			width: 300px;
			margin-top: 10px;
			
			//参数说明:园渐变或线性渐变 [left|right] 坐标数 [top|bottom] 坐标数 repeat参数,
			background: radial-gradient(circle at 10px 10px, transparent 5px, #fff 5px) left -10px top 0 repeat-y,
				linear-gradient(90deg, #fff, #feaaaa) left 10px top 0 no-repeat,
				radial-gradient(circle at 10px 0, transparent 5px, #feaaaa 5px) left calc(40% - 5px) top 0 no-repeat,
				radial-gradient(circle at 10px 10px, transparent 5px, #feaaaa 5px) left calc(40% - 5px) bottom 0px no-repeat,
				linear-gradient(90deg, #feaaaa, #fe434c) right 10px top 0 no-repeat,
				radial-gradient(circle at 10px 10px, transparent 5px, #fe434c 5px) right -10px top 0 repeat-y;

			//背景结构大小,顺序对应background里的背景内容
			background-size: 20px 17px,
				calc(40% - 15px) 88px,
				20px 78px,
				20px 10px,
				calc(60% - 15px) 88px,
				22px 17px;

		}
  </style>
 </head>
 <body style="background-color: rgba(127, 193, 255, 1)">
	<div style="width: 500px">
		<div class="coupon"></div>
		<div class="coupon"></div>
		<div class="coupon"></div>
	</div>
 </body>
</html>

执行效果:
在这里插入图片描述

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值