我有一個複選框的形式。 我希望複選框和標籤不可見,並用圖標替換它們。 我希望圖標具有複選框的功能。取代與圖像,圖標或背景的複選框,並保持功能
而不是一個圖標我現在只是使用背景。當我點擊背景時,我希望表單改變顏色(通過選擇複選框)。 當我再次點擊時,表單應該返回到正常的顏色。
在我的真實形式複選框應用過濾器,所以我需要複選框的功能。
無法真正得到它的任何工作。
https://jsfiddle.net/rom6qr84/1/
.form-item-edit-how-40 {
display: inline-block;
padding: 20px;
width: 50px;
height: 50px;
background: yellow;
}
.form-item-edit-how-40:active,
.form-item-edit-how-40:hover {
background: red;
}
input:checked {
background: green;
}
input,
label {
//display: none;
//visibility: hidden;
}
label {
background: grey;
width: 50px;
height: 50px;
}
<div class="form-item-edit-how-40">
<input type="checkbox" name="how[]" id="edit-how-40" value="40" data-placeholder="KIES JE TRANSPORT" placeholder="KIES JE TRANSPORT">
<label class="option" for="edit-how-40">Met de bus</label>
</div>
不得不做出一些額外的變化,但得到它的工作,THX! https://jsfiddle.net/99urq40n/1/ –