input[type=checkbox] + label {
display: block;
margin: 0.2em;
cursor: pointer;
padding: 0.2em;
}
input[type=checkbox] {
display: none;
}
input[type=checkbox] + label:before {
content: "2714";
border: 0.1em solid MediumSeaGreen;
border-radius: 0.2em;
display: inline-block;
width: 1em;
height: 1em;
padding-left: 0.2em;
padding-bottom: 0.3em;
margin-right: 0.2em;
vertical-align: bottom;
color: transparent;
transition: .2s;
}
input[type=checkbox] + label:active:before {
transform: scale(0);
}
input[type=checkbox]:checked + label:before {
background-color: MediumSeaGreen;
border-color: MediumSeaGreen;
color: #fff;
}
input[type=checkbox]:disabled + label:before {
transform: scale(1);
border-color: #aaa;
}
input[type=checkbox]:checked:disabled + label:before {
transform: scale(1);
background-color: #bfb;
border-color: #bfb;
}
<p>
<input type="checkbox" id="showall" name="showall" value=0>
<label for="showall">Show All</label>
</p>
<p>
<input type="checkbox" id="showfl" name="showfl" value=0>
<label for="showfl">Filtered</label>
</p>
<p>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…