【发布时间】:2012-08-27 23:07:53
【问题描述】:
如果选中收音机,我希望标签有一个红色边框。
到目前为止的代码:
HTML:
<center style="margin-top:20px;">
<label class="big">
This is a box 1
<input name="radio-group1" type="radio" />
</label>
<br/>
<label class="big">
This is a box 2
<input name="radio-group1" type="radio" class='sex' />
</label>
</center>
CSS:
.big {
display:block;
width:100px;
height:100px;
background-color:gainsboro;
cursor:pointer;
}
.big:hover {
border:1px solid blue;
}
请不要使用 JS 解决方案。我一直在尝试使用兄弟选择器和子选择器,但没有成功。
JSFIDDLE:http://jsfiddle.net/QqVCu/10/
【问题讨论】:
-
这是一个关于复选框的问题的副本;单选按钮的大小写完全相同。