bulma:水平表单控件未正确展开
bulma: horizontal form controls not expanded correctly
我有 1 个文本输入和 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 个选择应该采用它们的实际宽度,第一个输入应该扩展直到它采用可用 space,但这就是我得到的:
将is-narrow
添加到您要缩小的字段:
<div class="field is-narrow">
您需要将 control is-expanded
与 select is-fullwidth
合并。
这是一个例子:
@import url('https://cdnjs.cloudflare.com/ajax/libs/bulma/0.4.2/css/bulma.min.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 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>
我有 1 个文本输入和 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 个选择应该采用它们的实际宽度,第一个输入应该扩展直到它采用可用 space,但这就是我得到的:
将is-narrow
添加到您要缩小的字段:
<div class="field is-narrow">
您需要将 control is-expanded
与 select is-fullwidth
合并。
这是一个例子:
@import url('https://cdnjs.cloudflare.com/ajax/libs/bulma/0.4.2/css/bulma.min.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 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>