css custom checkbox

WBOY
Release: 2016-06-24 11:41:41
Original
1006 people have browsed it

A virgin coming to CSDN asks:
The story started because I wanted to simply use CSS to customize the style of a checkbox, and then I did this:

<input id = "my-checkbox" type = "checkbox"/><label for = "my-checkbox"></label>
Copy after login

input[type="checkbox"]{opacity:0;}input[type="checkbox"] + label:before{background:#d5d5d5;      content:"";      height: 15px;      width: 15px;      position: absolute;      top: 0;      left: 0;  }
Copy after login

I wrote the above method based on the iCheck plug-in. The BUT instructor said that my method is not good (fall!)
He said: ID abuse will make it difficult to check for duplicate IDs in the future, so he asked me to wrap the in
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template