CSS3径向渐变实现优惠券波浪造型

效果看下图:

 

左右的波浪边框用CSS搞定这个效果。利用CSS radial-gradient() 函数

CSS 语法:

background: radial-gradient(shape size at position, start-color, ..., last-color);

直接上代码如下:

<div class="coupon"></div>

css部分:

.coupon {
  position: relative;
  width: 400px;
  height: 160px;
  margin: 100px auto;
  text-align: -webkit-auto;
  background-image: radial-gradient(
      circle at 1px 8px,
      transparent 6px,
      #ff9e6d 6px,
      #ff9e6d 0px
    ),
    radial-gradient(
      circle at 199px 8px,
      transparent 6px,
      #ff9e6d 6px,
      #ff9e6d 0px
    );
  background-size: 200px 18px;
  background-position: 0 0, 200px 0;
  background-repeat-x: no-repeat;

  font-size: 60px;
  color: #fff;
  font-weight: bold;
  line-height: 160px;
  padding-left: 60px;
  box-sizing: border-box;
  cursor: pointer;
}
.coupon::before {
  position: absolute;
  content: "";
  left: 240px;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1px dashed #fff;
}
.coupon::after {
  position: absolute;
  content: "立即领取";
  font-size: 26px;
  width: 70px;
  top: 50%;
  right: 2%;
  transform: translate(-50%, -50%);
  line-height: 40px;
  letter-spacing: 5px;
}

 

 

 



转载于:https://www.cnblogs.com/lwming/p/10925702.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值