css实现antd丝带效果

打印 上一主题 下一主题

主题 869|帖子 869|积分 2617

先上效果图:

代码:
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6.     <title>Document</title>
  7. </head>
  8. <style>
  9.     .ant-ribbon {
  10.         box-sizing: border-box;
  11.         margin: 0;
  12.         padding: 0 8px;
  13.         color: #1677ff;
  14.         font-size: 14px;
  15.         line-height: 22px;
  16.         list-style: none;
  17.         position: absolute;
  18.         top: 8px;
  19.         white-space: nowrap;
  20.         background-color: #1677ff;
  21.         border-radius: 4px;
  22.         border-end-end-radius: 0;
  23.     }
  24.     .ant-ribbon-text {
  25.         color: #ffffff;
  26.     }
  27.     .ant-ribbon-placement-end {
  28.         inset-inline-end: 8px;
  29.         border-end-end-radius: 0;
  30.     }
  31.     .ant-ribbon-corner {
  32.         position: absolute;
  33.         top: 100%;
  34.         width: 8px;
  35.         height: 8px;
  36.         color: currentcolor;
  37.         border: 4px solid;
  38.         transform: scaleY(0.75);
  39.         transform-origin: top;
  40.         filter: brightness(75%);
  41.         box-sizing: border-box;
  42.         inset-inline-end: 0;
  43.         border-inline-end-color: transparent;
  44.         border-block-end-color: transparent;
  45.     }
  46. </style>
  47. <body>
  48.     <div class="ant-ribbon ant-ribbon-placement-end">
  49.         <span class="ant-ribbon-text">5.17.0</span>
  50.         <div class="ant-ribbon-corner">
  51.         </div>
  52.     </div>
  53. </body>
  54. </html>
复制代码


免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

篮之新喜

金牌会员
这个人很懒什么都没写!
快速回复 返回顶部 返回列表