input 更改自定义CheckBox 颜色

 

css样式

      </style>
        input[type=checkbox] {
            cursor: pointer;
            position: relative;
            width: 15px;
            height: 15px;
            font-size: 14px;
        }
        input[type=checkbox]::after {
            position: absolute;
            top: 0;
            color: rgb(130, 35, 35);
            width: 15px;
            height: 15px;
            display: inline-block;
            visibility: visible;
            padding-left: 0px;
            text-align: center;
            content: ' ';
            border-radius: 3px
        }

        input[type=checkbox]:checked::after {
            content: "√";
            color: #fff;
            font-size: 12px;
            font-weight: bold;
           // background-color: black;
            background-color: #fa2e2e;
        }
    </style>
    

body

      <div>
         <label>
            <input type="checkbox"></input>
         </label>
         <span>用户协议 隐私协议授权&gt;</span>
      </div>


版权声明:本文为weixin_61710685原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。