我只需要使用CSS的复选框帮助。复选框与选中状态下的图像和覆盖图像
首先它的功能正常。但是,当点击按钮时,我想将选中的图像覆盖在未选中图像的顶部。如何实现这一目标?
.frm_checkbox {border: 1px solid red;}
.frm_checkbox input[type="checkbox"] {display: none; }
input#field_32gyuu-0 {
\t background: url('http://www.uswebcompany.com/plugins/formidable/wp-content/uploads/2016/01/christmasLights.png') 0 0px no-repeat;
z-index: 10;
\t content: "";
\t display: inline-block;
\t font-size: 12px;
\t height: 75px;
\t width: 75px;
\t line-height: 16px;
\t margin: -2px 6px 0 0;
\t text-align: center;
\t vertical-align: middle;
}
#frm_checkbox_112-0 input[type="checkbox"]:checked + label:before {
\t background: url('http://www.uswebcompany.com/plugins/formidable/wp-content/uploads/2016/01/lightbox-checkmark.png') 0 0px no-repeat;
\t height: 75px;
\t width: 75px;
}
<div id="frm_field_162_container" class="frm_form_field form-field form-group frm_top_container">
<label class="frm_primary_label control-label">Checkboxes
<span class="frm_required"></span>
</label>
<div class="frm_opt_container">
<div class="frm_checkbox checkbox" id="frm_checkbox_162-0">
<label for="field_32gyuu-0">
<input type="checkbox" name="item_meta[162][]" id="field_32gyuu-0" value="Option 1" /> Option 1</label>
</div>
<div class="frm_checkbox checkbox" id="frm_checkbox_162-1">
<label for="field_32gyuu-1">
<input type="checkbox" name="item_meta[162][]" id="field_32gyuu-1" value="Option 2" /> Option 2</label>
</div>
</div>
</div>
它不是在这里工作。尝试使用jsfiddle或jsbin。 –
先生,它正在工作尽可能复选框。但是,我试图删除复选框并放置图像,并使其可以用叠加复选标记进行点击。 –