zoukankan      html  css  js  c++  java
  • css三角形升级(秒杀效果)

    <!DOCTYPE html>
    <html lang="en">
    
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
        <style>
            * {
                padding: 0;
                margin: 0;
            }
    
            .box {
                width: 0;
                height: 0;
                /* 上边框宽度调大 */
                border-top: 100px solid transparent;
                border-right: 50px solid skyblue;
                /* 下和左边的边框宽度设置为0 */
                border-bottom: 0;
                border-left: 0;
            }
    
            /* 简写:三角形 */
            .triangle {
                width: 0;
                height: 0;
                /* 只保留右边的边框有颜色 */
                border-color: transparent red transparent transparent;
                border-style: solid;
                /* 上边框宽度变大,右边框小些,下和左为0 */
                border-width: 100px 50px 0 0;
            }
    
            /* 价格 */
            .price {
                width: 160px;
                height: 24px;
                border: 1px solid red;
                margin: 0 auto;
                line-height: 24px;
            }
    
            .miaosha {
                position: relative;
                float: left;
                width: 90px;
                height: 100%;
                background-color: red;
                text-align: center;
                color: white;
                font-weight: 700;
                margin-right: 8px;
            }
    
            .miaosha i {
                position: absolute;
                right: 0;
                top: 0;
                width: 0;
                height: 0;
                border-color: transparent white transparent transparent;
                border-style: solid;
                /* 上边框宽度变大,右边框小些,下和左为0 */
                border-width: 24px 10px 0 0;
            }
    
            /* 删除效果 */
            .origin {
                color: gray;
                text-decoration: line-through;
            }
        </style>
    </head>
    
    <body>
        <div class="box"> </div>
        <div class="triangle"> </div>
        <div class="price">
            <span class="miaosha">
                ¥1650
                <i></i>
            </span>
            <span class="origin">¥2650</span>
        </div>
    </body>
    
    </html>

  • 相关阅读:
    HelloCSS-Border
    开发你的第一个NCS(Zephyr)应用程序
    NanoPi R4S (RK3399) openssl speed 硬件加解密性能测试结果
    Flink-状态
    Flink-时间语义和Watermark
    Flink-Window
    Flink-运行时架构
    Flink-流处理wordcount
    Flink-批处理wordcount
    设计模式七大原则-合成复用原则
  • 原文地址:https://www.cnblogs.com/lyt520/p/15734276.html
Copyright © 2011-2022 走看看