通过css继承来实现气泡小三角

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title></title>
    <style media="screen">
      .callout{position: relative;
        width: 100px;
        height: 50px;
        background: #f00;
      }
      .callout::before{
        content: "";
        position: absolute;
        top: -.4em; left: 1em;
        padding: .35em;
        background: inherit;
        border: inherit;
        border-right:0;
        border-bottom:0;
        transform: rotate(45deg);
      }
    </style>
  </head>
  <body>
    <div class="callout">
      Only
    </div>
  </body>
</html>

 

posted @ 2018-09-01 00:08  renyangli  阅读(139)  评论(0编辑  收藏  举报