<div class="checkbox">
<label>
<input type="checkbox" name="checkbox[]" class="checkbox-input">
<span class="checkbox-parts">チェックボックス01</span>
</label><br>
<label>
<input type="checkbox" name="checkbox[]" class="checkbox-input">
<span class="checkbox-parts">チェックボックス02</span>
</label><br>
<label>
<input type="checkbox" name="checkbox[]" class="checkbox-input">
<span class="checkbox-parts">チェックボックス03</span>
</label>
</div>
.checkbox-input{
display: none;
}
.checkbox-parts{
padding-left: 20px;
position:relative;
margin-right: 20px;
}
.checkbox-parts::before{
content: "";
display: block;
position: absolute;
top: 0;
left: 0;
width: 15px;
height: 15px;
border: 1px solid #999;
border-radius: 4px;
}
.checkbox-input:checked + .checkbox-parts{
color: #d01137;
}
.checkbox-input:checked + .checkbox-parts::after{
content: "";
display: block;
position: absolute;
top: -5px;
left: 5px;
width: 7px;
height: 14px;
transform: rotate(40deg);
border-bottom: 3px solid #d01137;
border-right: 3px solid #d01137;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.