用css做一个朋友圈评论图标

先看下效果图:
效果图
再看下源码

<!DOCTYPE html>
<html class="no-js">
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title></title>
    <meta name="description" content="" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="stylesheet" href="" />
    <style>
      .comment {
        height: 20px;
        width: 25px;
        background: #8593b0;
        position: relative;
        cursor: pointer;
        display: flex;
        justify-content: center;
      }
      .comment::before {
        content: '';
        border: 5px solid transparent;
        border-right: 5px solid #8593b0;
        position: absolute;
        top: 5px;
        left: -10px;
      }
      span {
        color: #f8f8f8;
        font-size: 30px;
        line-height: 20px;
        position: absolute;
        top: -10px;
      }
    </style>
  </head>
  <body>
    <div class="comment">
      <span>..</span>
    </div>
  </body>
</html>

猜你喜欢

转载自blog.csdn.net/sunfellow2009/article/details/87715260