css实现优惠券

1,144 阅读1分钟
<div class="coupon">
        <div class="coupon-left">
            <div class="amount">
                <p class="amount-num">¥<span>200</span></p>
                <p class="amount-des">满400可用</p>
            </div>
            <div class="shop">
                <p class="shop-name">商店名称店铺名称</p>
                <p class="shop-time">2020-01-01起 <br> 2020-02-01止</p>
            </div>
        </div>
        <div class="coupon-right">
            待使用
            <div class="circle-t"></div>
            <div class="circle-b"></div>
        </div>
    </div>
        *{
            margin: 0;
            padding: 0;
        }
        .main {
            background: #f8f8f9;
            padding: 1px;
        }

        .coupon {
            margin: 10px;
            background: #fff;
            padding: 10px;
            color: #6a6a6a;
            border-radius: 6px;
            display: flex;
            flex-flow: row nowrap;
            justify-content: space-between;
        }

        .coupon-left{
            width: 0;
            flex: auto;
            display: flex;
            flex-flow: row nowrap;
            justify-content: flex-start;
        }
        .amount{
            width: 100px;
            text-align: center;
            flex: none;
            color: #db251c;
        }
        .amount-num span{
            font-size: 24px;
            font-weight: bold;

        }
        .amount-des{
            color: #666;
            font-size: 12px;
            margin-top: 12px;
        }
        .shop{
            width: 0;
            flex: auto;
        }
        .shop-time{
            font-size: 12px;
            color: #666;
            margin-top: 20px;
        }
        .coupon-right{
            width: 80px;
            flex: none;
            border-left: 1px dashed #999;
            position: relative;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }
        .circle-t{
            width: 20px;
            height: 12px;
            border-radius:0px 0px 100px 100px;
            background-color: #f8f8f9;
            /*border: 1px solid gray;*/
            /*border-left: none;*/
            position: absolute;
            top: -10px;
            left: -10px;
        }
        .circle-b{
            width: 20px;
            height: 12px;
            border-radius:100px 100px 0px 0px;
            background-color: #f8f8f9;
            /*border: 1px solid gray;*/
            /*border-left: none;*/
            position: absolute;
            left: -10px;
            bottom: -10px;
        }