我有一个文本输入和2个选择我想要将它们水平放置。基于bulma css框架,我应该做的事情:
<div class="field is-horizontal">
<div class="field-body">
<div class="field">
<p class="control is-expanded has-icons-left">
<input class="input" type="text" placeholder="Search" name="id" id="id">
<span class="icon is-small is-left"><i class="fa fa-search"></i></span>
</p>
</div>
<div class="field">
<p class="control">
<span class="select">
<select name="status" id="status">
<option value="">Status:</option>
<option value="active">active</option>
<option value="pause">pause</option>
</select>
</span>
</p>
</div>
<div class="field">
<p class="control">
<span class="select">
<select name="limit" id="limit">
<option value="">Limits:</option>
<option value="10">10</option>
<option value="20">20</option>
</select>
</span>
</p>
</div>
</div>
通常最后2个选择应该采用它们的实际宽度,第一个输入应该扩展,直到它占用可用空间,但这是我得到的:
答案 0 :(得分:1)
答案 1 :(得分:0)
您需要将control is-expanded
与select is-fullwidth
合并。
以下是一个例子:
@import url('https://cdnjs.cloudflare.com/ajax/libs/bulma/0.4.2/css/bulma.min.css');
&#13;
<div class="field is-horizontal">
<div class="field-body">
<div class="field">
<p class="control is-expanded has-icons-left">
<input class="input" type="text" placeholder="Search" name="id" id="id">
<span class="icon is-small is-left"><i class="fa fa-search"></i></span>
</p>
</div>
<div class="field">
<p class="control is-expanded">
<span class="select is-fullwidth">
<select name="status" id="status">
<option value="">Status:</option>
<option value="active">active</option>
<option value="pause">pause</option>
</select>
</span>
</p>
</div>
<div class="field">
<p class="control is-expanded">
<span class="select is-fullwidth">
<select name="limit" id="limit">
<option value="">Limits:</option>
<option value="10">10</option>
<option value="20">20</option>
</select>
</span>
</p>
</div>
</div>
&#13;