<div class="box">
<input type="checkbox" id="check01" name="選択肢" checked="">
<label for="check01" class="checkBoxDesign">CHECK01</label>
<input type="checkbox" id="check02">
<label for="check02" class="checkBoxDesign">CHECK02</label>
<input type="checkbox" id="check03">
<label for="check03" class="checkBoxDesign">CHECK03</label>
</div>
input[type=checkbox] {
display: none;
}
.checkBoxDesign {
box-sizing: border-box;
cursor: pointer;
display: inline-block;
padding: 0.6rem 2rem;
position: relative;
}
.checkBoxDesign::before {
background: #fff;
border: 1px solid #ccc;
border-radius: 3px;
content: '';
display: block;
height: 16px;
left: 5px;
margin-top: -8px;
position: absolute;
top: 50%;
width: 16px;
}
.checkBoxDesign::after {
border-right: 6px solid #ff7c1f;
border-bottom: 3px solid #ff7c1f;
content: '';
display: block;
height: 20px;
left: 7px;
margin-top: -16px;
opacity: 0;
position: absolute;
top: 50%;
transform: rotate(45deg);
width: 9px;
}
input[type=checkbox]:checked + .checkBoxDesign::before {
border-color: #ccc;
}
input[type=checkbox]:checked + .checkBoxDesign::after {
opacity: 1;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.