gpt4 book ai didi

html - 内联 Bootstrap 多个输入

转载 作者:行者123 更新时间:2023-11-28 17:20:53 24 4
gpt4 key购买 nike

我很难在我的表单中将两个和一个文本输入放在一行中。我能够获得两个内联选择,但文本输入很顽固。这是当前代码的样子:

enter image description here

<form role='form' action='#' method='post'>
<div class='form-group'>
<label for='query-bar' class='sr-only'></label>
<input type='text' class='form-control' placeholder='Enter search query..' name='query-bar' />
</div>
<div class='form-inline'>
<div class='form-group'>
<select name='builder-columns' class='form-control'>
<option selected disabled value='none'>Columns</option>
<option></option>
</select>
</div>
<div class='form-group'>
<select name='builder-operators' class='form-control'>
<option selected disabled value='none'>Operators</option>
</select>
</div>
<div class='form-group'>
<label for='builder-filter' class='sr-only'></label>
<input type='text' placeholder='Filter' name='builder-filter' class='form-control' />
</div>
</div>
</form>

最佳答案

您可以使用以下内容:

<div class='form-inline row'>
<div class='form-group col-sm-4'>
<select name='builder-columns' class='form-control'>
<option selected disabled value='none'>Columns</option>
</select>
</div>
<div class='form-group col-sm-4'>
<select name='builder-operators' class='form-control'>
<option selected disabled value='none'>Operators</option>
</select>
</div>
<div class='form-group col-sm-4'>
<label for='builder-filter' class='sr-only'></label>
<input type='text' placeholder='Filter' name='builder-filter' class='form-control' />
</div>
</div>
.form-inline .form-control {
width: 100%;
}

row 被添加到 form-inline 元素,类 col-sm-4 被添加到 form-group 元素。此外,.form-control 元素的宽度被设置为 100% 以覆盖在某些情况下应用的 width: auto屏幕尺寸。

Example Here

关于html - 内联 Bootstrap 多个输入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27894442/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com