我正在寻找一种方法,有一个文本输入和两个按钮相邻的两个按钮,按钮占用他们需要的水平空间,而输入占用剩余的空间。我也希望元素之间的边距很小,我更喜欢使用Bootstrap 4类来实现这一点。 我希望我可以使用三个col-auto div,但这样输入的像素固定为150px: <!-- Input. This should be as wide as possible. -->
<div class='col-auto'>
<input class='form-control'
type='text
由于标签文本长度的不同,这两个输入会出现对齐错误。下面是我代码的一部分:
<div class="row">
<div class="col-auto col-md-6 form-group">
<label for="category">Which of the following best describes you?</label>
<select class="form-control" id="catego