修改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;
    }

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM