伪元素的妙用

一:对勾

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>对勾</title>
  <style>
    *, :after, :before {
      box-sizing: border-box;
      -webkit-box-sizing: border-box;
    }
    a {
      text-decoration: none;
    }
    .message {
      text-align: center;
    }
    .success {
      font-size: 16px;
      font-weight: 600;
      color: #42c02e;
    }
    .success:before {
      content: '';
      display: inline-block;
      width: 18px;
      height: 10px;
      border-width: 0 0 4px 4px;
      border-style: solid;
      transform: rotate(-45deg);
      -webkit-transform: rotate(-45deg);
      position: relative;
      bottom: 4px;
      right: 8px;
    }
  </style>
</head>
<body>
  <div class="message">
    <a href="#" class="success">发布成功,点击查看文章</a>
  </div>
</body>
</html>
posted @ 2019-06-07 16:14  暮雪&&如霜  阅读(122)  评论(0编辑  收藏  举报