【问题标题】:I am working on a website with bootstrap4我正在使用 bootstrap4 开发网站
【发布时间】:2020-08-19 00:30:36
【问题描述】:

FORM

我正在创建这样的表单,但我不知道如何将所有单选按钮连续放置。有人可以帮我解决这个问题。

客人人数 1

                       <input type="radio" name="opt2" class="form-control" id="opt2">
                      <label for="opt1">2</label>

                      <input type="radio" name="opt3" class="form-control" id="opt3">
                      <label for="opt3">3</label>
                      <input type="radio" name="opt4" class="form-control" id="opt4">
                      <label for="opt4">4</label>
                      <input type="radio" name="opt5" class="form-control" id="opt5">
                      <label for="opt5">5</label>

                       </div>


              </div> 
            </form>

这是我的单选按钮代码。当我运行此代码时,所有按钮都垂直放置。

请不要报告这个问题。我是这个平台上的菜鸟,所以我不知道它是如何工作的。 提前谢谢你。

【问题讨论】:

    标签: html forms bootstrap-4


    【解决方案1】:

    使用此代码:

    <div>
      <div class="row">
        <div class="form-check form-check-inline">
          <input name="gruppo2" type="radio" id="radio4" checked>
          <label for="radio4">Opzione 1</label>
        </div>
        <div class="form-check form-check-inline">
          <input name="gruppo2" type="radio" id="radio5">
          <label for="radio5">Opzione 2</label>
        </div>
      </div>
    </div>
    

    什么变化?如果你使用 form-check-inline 类输入单选将显示在一行中。

    【讨论】:

    • 你能接受我的回答吗?
    • 是的,当然!但我不知道该怎么做
    • 在我的答案上向左看,您可以看到一个“V”按并且将是绿色的,然后在那个“V”上您可以看到一个向上和向下按向上箭头的小箭头。谢谢
    • 完成了吗?它不会公开显示,因为我的声望少于 15 个。
    • 我无法提问,他们说我必须等待 7 天。但我有一点怀疑。有没有其他方法可以在这里提问,或者有没有其他平台和这个一样好?谢谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-02-13
    相关资源
    最近更新 更多