html - 如何在标签和单选按钮之间添加空格? Bootstrap 4

标签 html css bootstrap-4 radio-button

我试过这个solution但它不起作用,有什么建议可以实现吗?

<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet"/>
<div class="form-row">
  <div class="col-4">
    <p>Signing on behalf of</p>
    <label class="radio-inline" style="">
      <input type="radio" name="optradio" checked="true" style="padding-left:15px;">A Company
      </label>
    <label class="radio-inline" style="padding-left:15px;">
      <input type="radio" name="optradio" style="padding-left:15px;">An Individual
      </label>
  </div>
</div>

JSfiddle

最佳答案

input tag don't have closing tag, second wrap label inside span and give it a margin

label span{
  display:inline-block;
  margin-left: 10px;
}
<div class="form-row">
   <div class="col-4">
      <p>Signing on behalf of</p>
      <label class="radio-inline" style="">
      <input type="radio" name="optradio" checked="true" style="padding-left:15px;"><span>A Company</span>
      </label>
      <label class="radio-inline" style="padding-left:15px;">
      <input type="radio" name="optradio" style="padding-left:15px;"><span>An Individual</span>
      </label>
   </div>
</div>

关于html - 如何在标签和单选按钮之间添加空格? Bootstrap 4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60188731/

相关文章:

html - bootstrap 4 carousel 不同图像尺寸和屏幕尺寸的相同高度

jquery - 用多个div更改单个文本区域并更改div图像

jquery - jqGrid 卡住列中出现错误

css - nivo slider 的定位

带 Angular CSS 菱形 (120, 60, 120, 60)

css - 使用 Reactstrap : Unable to apply CSS styles to image for CarouselItem and how to use div instead of image

html - Django 中的 Bootstrap4 未按预期工作

java - 为什么 String.equals() 方法在 JSTL Core 标签 <c :if>? 中不起作用

html - 如何使表格能够使用 Twitter Bootstrap 进行排序?

html - 我怎样才能制作八 Angular 形盒子?