【发布时间】:2015-08-14 16:20:56
【问题描述】:
我正在尝试让以下代码工作:
html
<div class = "col-md-4 video text-center wrapper-q1">
<p class = "no-padding">
<input class="question1" id = "vraag1" type="radio" name="q1" value="Moon"> <br />
<label class = "pointer" for = "vraag1">Text</label>
</p>
</div>
css
input[type="radio"] {
display:none;
}
label:before {
content: "";
display: block;
width: 33px;
height:33px;
margin:0 auto;
background-image: url("../img/radio-btn.png");
}
input[type=radio]:checked + label {
content: "";
background-image: url("../img/radio-btn-checked.png");
font-size: 30px;
text-align: center;
line-height: 18px;
}
显示单选按钮,但当我单击它时,它不会变为“选中”图像。
感谢您的帮助!
【问题讨论】:
标签: html css input radio checked