如何使单选按钮靠近标签?
input[type="radio"]{
float: left;
width: auto;
margin-left: 3em;
}
<fieldset id="payment_method">
<legend>Payment Method</legend>
<input type="radio" name="payment_method"value="Bill Me">
<label for= "payment1"> Bill Me</label>
<input type="radio" name="payment_method"value="Bill Me">
<label for= "payment2">Credit Card</label>
</fieldset>
您不需要浮动输入,您可以给标签加上负的边距,如下所示:
label {
margin-left: -1px;
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句