修改input复选框样式

效果:

 代码:

input[type='checkbox'] {
      cursor: pointer;
      position: relative;
      width: 18px;
      height: 18px;
      font-size: 16px;
      visibility: hidden;
    }
   input[type='checkbox']::after {
      position: absolute;
      top: 0;
      background-color: #fff;
      color: #fff;
      border: 1px solid #b1b1b1;
      width: 18px;
      height: 18px;
      display: inline-block;
      visibility: visible;
      padding-left: 0px;
      text-align: center;
      content: ' ';
      border-radius: 50%;
      box-sizing: border-box;
    }

    input[type='checkbox']:checked::after {
      background-color: $color-main;
      border: none;
      content: '\2713';
      font-size: 14px;
      font-weight: bold;
    }

猜你喜欢

转载自www.cnblogs.com/duanzhenzhen/p/13186700.html
今日推荐