我想要文本和单选按钮之间的单个空格。为了实现这一点,我通过添加 margin-left: 7px 尝试了 css 类 answerBottomYesNo 。由于某种原因,它不起作用。下面是代码片段
<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>
Run Code Online (Sandbox Code Playgroud)
我应该怎么做才能在单选按钮和文本之间留出空格。我本可以做 nbsp,但我真的希望它驻留在 CSS 文件中。帮助表示赞赏!
而不是span,像这样添加margin到input type=radio里面span:
.answerBottomYesNo input[type="radio"]{
margin-right:20px;
}
Run Code Online (Sandbox Code Playgroud)
查看工作小提琴:https : //jsfiddle.net/4ageousp/
| 归档时间: |
|
| 查看次数: |
13146 次 |
| 最近记录: |