借助Twitter Bootstrap 3.3.7,我试图排列多个问题,其中包含内嵌单选按钮答案,并让所有问题的单选按钮排列起来,以便最终用户显示更好。使用Twitter Bootstrap排列单选按钮答案
如果这是在超小设备,我希望单选按钮位于下一行。
我遇到的麻烦是应用col-sm-6
(或任何列大小)似乎不工作,因为我期望。 help-block
没有完全转到下一行,它卡在单选按钮下。
我期待能够使用正确的Twitter Bootstrap表单语法。这是可能的形式语法,或者这是否需要使用自己的行/ cols?
问题的一个例子:的jsfiddle https://jsfiddle.net/y8j5f0of/
<div class="row">
<div class="form-group">
<label class="col-sm-6">This is an example question</label>
<div class="col-sm-6">
<label class="radio-inline">
<input type="radio" name="answer1" value="Yes"> Yes
</label>
<label class="radio-inline">
<input type="radio" name="answer1" value="No"> No
</label>
</div>
<span class="help-block">This is an example help block that has a lot of text that should start under the question instead of the answer.</span>
</div>
</div>
答案一字排开,但输出不正常流动。
如果我删除col-sm-6
,符合市场预期但答案是不排队的一切流动。此外,这不允许单选按钮去他们自己的线额外的小设备。
的jsfiddle https://jsfiddle.net/nz36k74o/1/
<div class="row">
<div class="form-group">
<label>This is an example question 1 that is longer than question 2</label>
<label class="radio-inline">
<input type="radio" name="answer1" value="Yes"> Yes
</label>
<label class="radio-inline">
<input type="radio" name="answer1" value="No"> No
</label>
<span class="help-block">This is an example help block that has a lot of text that should start under the question instead of the answer.</span>
</div>
</div>
输出
<跨度类= “帮助块COL-SM-6”>添加COL-SM-6在这里。 – tech2017
如果我做'col-xs-12',它会将帮助块包裹到下一行。看起来这是它可以用于我认为没问题的所有视图的唯一方式。如果你想回答下来,我会接受它 – Kirk
帮助块可以“内联块”而不是“块” – blecaf