css-京东秒杀价格样式效果

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .price {
            width: 160px;
            height: 24px;
            border: 1px solid red;
            margin: 0 auto;
            line-height: 24px;
            border-radius: 2px;
        }

        .miaosha {
            position: relative;
            float: left;
            background-color: red;
            width: 90px;
            height: 100%;
            color: #fff;
            font-size: 15px;
            margin-right: 8px;
            text-align: center;
        }

        .miaosha i {
            position: absolute;
            right: 0;
            width: 0;
            height: 0;
            border-color: transparent #fff transparent transparent;
            border-style: solid;
            border-width: 24px 12px 0 0;
        }

        .origin {
            font-size: 12px;
            color: gray;
            text-decoration: line-through;
        }
    </style>
</head>

<body>
    <div class="price">
        <span class="miaosha">
            ¥1650
            <i></i>
        </span>
        <span class="origin">¥2680</span>
    </div>
</body>

</html>
posted @ 2025-09-24 09:28  紫川先生  阅读(9)  评论(0)    收藏  举报