css 长方形三角绘制

image.png
css应该如何实现,感谢各位

外面框的样式

background: rgba(92,184,122,0.10);
border: 1px solid rgba(92,184,122,0.6);
border-radius: 3px 3px 3px 3px 2px;

里面文字的样式

font-family: PingFangSC-Regular;
font-size: 13px;
color: #5CB87A;
letter-spacing: 0;
line-height: 16px;
font-weight: 400;
阅读 2.4k
3 个回答
<!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>
  </head>
  <style>
    .dd {
      position: relative;
      display: inline-block;
      padding: 10px;
      white-space: nowrap;
      background-color: rgb(23, 206, 38);
      clip-path: polygon(8% 0, 100% 0, 100% 100%, 8% 100%, 0 50%);
   
    }
    .dd2 {
      position: absolute;
      padding: 10px;
      top: 2px;
      left: 2px;
      line-height: 1;
      z-index: 100;
      clip-path: polygon(8% 0, 100% 0, 100% 100%, 8% 100%, 0 50%);
      -webkit-clip-path: polygon(8% 0, 100% 0, 100% 100%, 8% 100%, 0 50%);
      right: 2px;
      background-color: rgb(159, 225, 16);
      bottom: 2px;
    }
  </style>
  <body>
    <div class="dd">
      <span> 订单审核 </span>
      <div class="dd2">订单审核</div>
    </div>
  </body>
</html>

三角形 + 长方形。。。

怎么绘制三角形,应该可以百度到

:before {background-image:url(<data-uri>)}
:after  {background-image:url(<data-uri>)}

应该就能解决了

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题