我正在练习我的自举技能,但由于某种原因我陷入了内联输入和选择的困境
这是我想要的输出
但是我以某种方式得到了
使用此代码
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" />
<div class="col-md-2">
<label>Length of Stay</label>
<div class="form-group d-inline">
<input type="text" class="form-control">
<select class="custom-select">
<option disabled selected>Select Length</option>
<option value="Years">Years</option>
<option value="Months">Months</option>
<option value="Days">Days</option>
</select>
</div>
</div>
你知道我该如何解决吗?
答案 0 :(得分:1)
将引导程序类d-flex
添加到form-group
。谢谢
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" />
<div class="col-md-2">
<label>Length of Stay</label>
<div class="form-group d-flex">
<input type="text" class="form-control">
<select class="custom-select">
<option disabled selected>Select Length</option>
<option value="Years">Years</option>
<option value="Months">Months</option>
<option value="Days">Days</option>
</select>
</div>
</div>