<div class="c-block-input">
<div class="c-block-input__items">
<div class="c-block-input__title">チェックボックス
</div>
<div class="c-block-input__checkbox">
<input type="checkbox" name="チェックボックス" id="checkbox01" checked>
<label for="checkbox01">選択肢1</label>
</div>
<div class="c-block-input__checkbox">
<input type="checkbox" name="チェックボックス" id="checkbox02">
<label for="checkbox02">選択肢2</label>
</div>
<div class="c-block-input__checkbox">
<input type="checkbox" name="チェックボックス" id="checkbox03">
<label for="checkbox03">選択肢3</label>
</div>
</div>
</div>
.c-block-input__items {
margin-bottom: 32px
}
.c-block-input__title {
font-size: 16px;
font-weight: 700;
margin-bottom: 10px;
display: block
}
.c-block-input__checkbox input[type=checkbox] {
display: none
}
.c-block-input__checkbox label {
box-sizing: border-box;
cursor: pointer;
display: inline-block;
padding: 3px 0 3px 30px;
position: relative;
width: auto
}
.c-block-input__checkbox label::before {
content: "";
display: block;
background: #fff;
border: 1px solid #999;
width: 15px;
height: 15px;
position: absolute;
left: 5px;
top: 50%;
margin-top: -6px
}
.c-block-input__checkbox label::after {
content: "";
display: block;
border-right: 3px solid #E6A54D;
border-bottom: 3px solid #E6A54D;
width: 5px;
height: 9px;
position: absolute;
left: 10px;
top: 50%;
margin-top: -6px;
opacity: 0;
transform: rotate(45deg)
}
.c-block-input__checkbox input[type=checkbox]:checked+label::after {
opacity: 1
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.