纯css写优惠券样式

<div class="coupon" :class="[showpop ? 'fadeup' : 'fadedown']">
      <p class="tt">领取优惠券<a>×</a></p>
      <ul>
        <li>
          <div class="cone">
            <div class="d2">商品券</div>
            <div class="d1">
              <div>
                <span>10</span>
                <span>元</span>
              </div>
              <div>
                <p>无门槛</p>
                <p>仅限购买蔬菜肉禽丹使用</p>
              </div>
            </div>
            <div class="d3">
              <p>【杭州一号店】有效期至2019-03-06</p>
              <button>立即领取</button>
            </div>
          </div>
        </li>
        <li>
          <div class="cone">
            <div class="d2">商品券</div>
            <div class="d1">
              <div>
                <span>10</span>
                <span>元</span>
              </div>
              <div>
                <p>无门槛</p>
                <p>仅限购买蔬菜肉禽丹使用</p>
              </div>
            </div>
            <div class="d3">
              <p>【杭州一号店】有效期至2019-03-06</p>
              <button>立即领取</button>
            </div>
          </div>
        </li>
      </ul>
    </div>
// 用到sass语言
.coupon {
    position:fixed;
    width:100%;
    transition:all 400ms ease;
    box-sizing:border-box;
    background:#F8F8F8;
    z-index:12;
    bottom: 0;
    p.tt {
      line-height: 80rpx;
      color: #333;
      font-size: 24rpx;
      text-align: center;
      padding: 0 30rpx;
    }
    a {
      font-size: 40rpx;
      color: #999999;
      float: right;
      line-height: 80rpx;
    }
    ul {
      padding: 0 30rpx;
      li {
        margin-bottom: 20rpx;
        .cone {
          width: 100%;
          div.d1 {
            padding: 30rpx 0;
            display: flex;
            background: linear-gradient(to top, #FFC875, #FABB5C);
            border-radius: 20rpx;
            div:nth-child(1) {
              width: 230rpx;
              border-right: 1rpx dashed #fff;
              color: #ffffff;
              text-align: center;
              line-height: 90rpx;
              span:nth-child(1) {
                font-size: 90rpx;
                font-weight: bold;
                margin-right: 10rpx;
              }
              span:nth-child(2) {
                font-size: 36rpx;
              }
            }
            div:nth-child(2) {
              padding: 0 0 0 40rpx;
              p {
                color: #fff;
                font-size: 26rpx;
                line-height: 45rpx;
              }
              p:nth-child(1) {
                margin-bottom: 20rpx;
              }
            }
          }
          div.d2 {
            font-size: 24rpx;
            padding: 0 15rpx;
            line-height: 40rpx;
            color: #FFAC30;
            background: linear-gradient(to top, #FFFDFD, #FFFFFF);
            right: 30rpx;
            position: absolute;
            margin-top: 20rpx;
            box-shadow:5px 2px 8px #FFAC30;
          }
          div.d2::before { // 这里写的是商品券的边角
            content:"";
            position: absolute;
            right: 100%;
            width: 0;
            height: 0;
            border-top: 20rpx solid #FFFDFD; 
            border-left: 15rpx solid transparent;
            border-bottom: 20rpx solid #FFFDFD; 
            border-left: 15rpx solid transparent;
          }
          div.d3 {
            background: #fff;
            padding: 0 50rpx;
            p {
              color: #999999;
              font-size: 20rpx;
              line-height: 60rpx;
            }
            button {
              float: right;
              color: #55C47D;
              border: 1rpx solid #55C47D;
              line-height: 36rpx;
              border-radius: 18rpx;
              padding:0 20rpx;
              font-size: 20rpx;
              margin-top: -50rpx;
            }
          }
          div.d3::before, div.d3::after { // 这里及以下是圆弧展示
            content:"";
            position: absolute;
            width: 40rpx;
            height: 40rpx;
            border-radius: 100%;
            background: #FFFDFD;
          }
          div.d3::before {
            left: 15rpx;
            margin-top: -20rpx;
          }
          div.d3::after {
            right: 15rpx;
            margin-top: -80rpx;
          }
        }
      }
    }

 

 

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值