首页 > Web开发 > 详细

【小实现】css after+border实现标签半菱形

时间:2019-11-28 01:53:42      阅读:84      评论:0      收藏:0      [点我收藏+]

技术分享图片

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

<head>
  <style>
    .span-line-begin {
      background-color: blue;
      position: relative;
      margin-right: 8px;
    }

    .span-line-begin:after {
      content: "";
      position: absolute;
      display: inline-block;
      width: 0;
      height: 0;
      border-top: 10px solid transparent;
      border-left: 10px solid blue;
      border-bottom: 10px solid transparent;
    }

    .span-line-end {
      background-color: blue;
      position: relative;
      margin-left: 8px;
    }

    .span-line-end::after {
      content: "";
      left: -10px;
      position: absolute;
      display: inline-block;
      width: 0;
      height: 0;
      border-top: 10px solid transparent;
      border-right: 10px solid blue;
      border-bottom: 10px solid transparent;
    }


    #triangle_right {
      width: 0;
      height: 0;
      border-top: 70px solid transparent;
      border-left: 140px solid #ff5a00;
      border-bottom: 70px solid transparent;
    }
  </style>

</head>

<body>
  <span>6152</span>
  <span class="span-line-begin">&lt;111&gt;</span>
  <span class="span-line-begin">&lt;222&gt;</span>
  <span>wew</span>
  <span class="span-line-end">&lt;/222&gt;</span>
  <span class="span-line-end">&lt;/111&gt;</span>weqwe

  <div id="triangle_right"></div>

</body>

</html>

【小实现】css after+border实现标签半菱形

原文:https://www.cnblogs.com/tangge/p/11946322.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!