1
どのように私はcss ckeckbox + lebelをid
とfor
なしで作ることができます。にはcssチェックボックスがありますか?
id
と、このような
for
持つことができますdosnt
:次に
<label class="checkbox">
<input type="checkbox" value="1" name="files" >
</label>
:私はこれを持っているしたい
<div class="checkbox">
<input id="f" type="checkbox" name="hi" class="checkbox" />
<label for="f">Hello</label>
</div>
しかしを私はこのCSS(実際にはSCSS)を使用しています:
label{
input[type=checkbox]{
display: none;
}
}
.checkbox{
position: relative;
display: inline-block;
margin-right: 7px;
cursor: pointer;
vertical-align: middle;
&:after{
content: ' ';
position: absolute;
border: 2px solid $black;
border-radius: 3px;
width: 20px;
height: 20px;
top: -5px;
left: -2px;
width: 14px;
height: 14px;
}
&:checked{
font-family: 'FontAwesome';
font-size: 2em;
content: "\f00c";
color: $blue;
border-radius: 3px;
}
}
/* It dosnt work */
.checkbox:after > input[type=checkbox]:checked {
font-family: 'FontAwesome';
font-size: 2em;
content: "\f00c";
color: $blue;
border-radius: 3px;
}
チェックボックスをオンにしていますか?
あなたのLabel
タグでスパンを使用する必要があります:)
こんにちはあるZeevカッツ作業great.Thanksそれは非常に多くの – amin