css实现antd丝带效果

先上效果图:

代码:

html 复制代码
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    .ant-ribbon {
        box-sizing: border-box;
        margin: 0;
        padding: 0 8px;
        color: #1677ff;
        font-size: 14px;
        line-height: 22px;
        list-style: none;
        position: absolute;
        top: 8px;
        white-space: nowrap;
        background-color: #1677ff;
        border-radius: 4px;
        border-end-end-radius: 0;
    }

    .ant-ribbon-text {
        color: #ffffff;
    }

    .ant-ribbon-placement-end {
        inset-inline-end: 8px;
        border-end-end-radius: 0;
    }

    .ant-ribbon-corner {
        position: absolute;
        top: 100%;
        width: 8px;
        height: 8px;
        color: currentcolor;
        border: 4px solid;
        transform: scaleY(0.75);
        transform-origin: top;
        filter: brightness(75%);
        box-sizing: border-box;
        inset-inline-end: 0;
        border-inline-end-color: transparent;
        border-block-end-color: transparent;
    }

</style>

<body>
    <div class="ant-ribbon ant-ribbon-placement-end">
        <span class="ant-ribbon-text">5.17.0</span>
        <div class="ant-ribbon-corner">
        </div>
    </div>
</body>

</html>
相关推荐
Csvn2 小时前
性能监控
前端
Csvn3 小时前
构建工具
前端
FRing033 小时前
vue2干货总结3(computed计算属性、watch监听器)
开发语言·前端·vue.js·vue2
kyriewen5 小时前
Skills 榜前 10 我全装了:只有 3 个能直接用
前端·javascript·程序员
IT_陈寒6 小时前
当Java的hashCode遇上Lombok,我的缓存被全清了
前端·人工智能·后端
工控丫丫6 小时前
帆软看板中经常使用的公式函数及经常搭的组合
前端·javascript·数据库
jerrywus7 小时前
我用 GPT-6.1-sol 做了台会讲解的 3D 售货机:60 罐饮料,一口没喝上
前端·agent·claude
孟陬8 小时前
Foobar 技术周刊#159:当看不懂代码时,如何高效排障调试。脏页陷阱:一条只读查询,写入数 TB 数据。推测解码:大模型加速利器
前端·人工智能·后端
Zhao-Jichao8 小时前
AI Prompting for Everyone 课程笔记 - P17 图像生成 Imaging Generation
前端
Highcharts.js9 小时前
智能数据分析组件Orbit 正式发布与快速上手体验教程
前端·人工智能·信息可视化·数据分析系统·highcharts·orbit·智能可视化