我是新來的CSS。給CSS複選框
我想將CSS複選框顯示在圖像中。
我都試過,但複選框出現在屏幕上,當我選擇的類別之一,那麼它的背景是黃色的。
謝謝。
.radio_toggle {
float:left;
}
.radio_toggle label {
float:left;
width:100px;
overflow:auto;
}
.radio_toggle label span {
text-align:center;
font-size: 15px;
padding:5px 0px;
display:block;
}
.radio_toggle label input {
position:absolute;
}
.radio_toggle .venue {
background-color:#edf1f2;
color: #58666e;
min-height: 100% !important;
border: thin #ced9db solid;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
}
<div class="categories">
<div class="radio_toggle">
<label class="venue" style="">
<input type="checkbox" name="toggle">
<span>Category</span>
</label>
</div>
</div>
<div class="categories">
<div class="radio_toggle">
<label class="venue" style="">
<input type="checkbox" name="toggle">
<span>Category</span>
</label>
</div>
</div>
<div class="categories">
<div class="radio_toggle">
<label class="venue" style="">
<input type="checkbox" name="toggle">
<span>Category</span>
</label>
</div>
</div>
所以你喜歡改變顏色如果它被選中。 – MatejMecka
是的..就像在後面應該有一個複選框,在上面它看起來像一個盒子或按鈕。選擇後顏色應該改變。 –