css实现带圆角梯形

<div class="box-item-num white">
    <span class="num">x <b>12</b></span>
</div>
&-num {
    width: 46px;
    height: 26px;
    font-size: 12px;
    position: absolute;
    left: -2px;
    top: 0;

    &::after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 2px;
        background: orange;
        transform: skewX(-15deg);
    }
    &::before {
        content: "";
        position: absolute;
        top: 0;
        left: -4px;
        width: 40px;
        height: 26px;
        background: orange;
    }

    .num {
        position: relative;
        z-index: 1;
        line-height: 26px;

        b{
            font-size: 20px;
            font-weight: 700;
        }
    }
}

posted @ 2022-09-01 10:56  生命在于折腾Up  阅读(2323)  评论(0编辑  收藏  举报