SOURCE

console 命令行工具 X clear

                    
>
console
 <h1>通过border创造两边的形状</h1>
  <div class="arrow"><span>已处理</span></div>  
  <div class="arrow active"><span>处理中</span></div>  
  <div class="arrow"><span>未处理</span></div>  
    body {
      padding: 10px;
    }
    .arrow {
      position: relative;
      display: inline-block;
      padding: 6px 12px;
      text-align: center;
      white-space: nowrap;
      vertical-align: middle;
      background-color: #ddd;
      cursor: pointer;
      user-select: none;
    }
    .arrow::before, .arrow::after {
      content: '';
      position: absolute;
      top: 0;
      display: inline-block;
      width: 0;
      height: 0;
    }
    .arrow::before {
      border-left: 16.6px solid transparent;
      border-top: 16.6px solid #ddd;
      border-bottom: 16.6px solid #ddd;
      left: -16.6px;
    }
    .arrow::after {
      border-left: 16.6px solid #ddd;
      border-top: 16.6px solid transparent;
      border-bottom: 16.6px solid transparent;
      right: -16.6px;
    }
    .arrow span {
      color: #666;
    }
    .arrow.active span {
      color: #fff;
    }
    .arrow.active {
      background-color: #5bc0de;
    }
    .arrow.active::before {
      border-top: 16.6px solid #5bc0de;
      border-bottom: 16.6px solid #5bc0de;
    }
    .arrow.active::after {
      border-left: 16.6px solid #5bc0de;
    }