我想要文本和单选按钮之间有一个空格。为了实现这一点,我尝试了 css 类 answerBottomYesNo 通过添加 margin-left: 7px 。由于某种原因它不起作用。
下面是代码片段
<div class="questionRow odd">
<div class="question">
Ear Aches?
</div>
<div class="answers">
<label for="rbEarAches1"><span class="answerBottomYesNo" ><input type="radio" id="rbEarAches1" name="EarAches" value="true" data-bind="checked: EarAches">Yes</span></label>
<label for="rbEarAches0"><span class="answerBottomYesNo"><input type="radio" id="rbEarAches0" name="EarAches" value="false" data-bind="checked: EarAches">No</span></label>
</div>
</div>
我应该怎么做才能在单选按钮和文本之间留出一个空格。我本来可以做 nbsp 但我真的希望它驻留在 CSS 文件中。帮助表示感谢!
代替span
, add margin
to input type=radio
在 - 的里面span
像这样:
.answerBottomYesNo input[type="radio"]{
margin-right:20px;
}
查看工作小提琴:https://jsfiddle.net/4ageousp/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)