gpt4 book ai didi

css - Bootstrap 输入按钮未与其他字段对齐

转载 作者:太空宇宙 更新时间:2023-11-03 23:05:23 26 4
gpt4 key购买 nike

a busy cat
(来源:bryancorrell.com)

我能够解决对齐问题,但后来我丢失了输入端的圆 Angular 并且无法弄清楚如何让它们恢复原状。请参阅以下链接:

https://jsfiddle.net/yzw8q28q/5/

<form class="simple_form form-inline" novalidate="novalidate" action="/dashboard/school" accept-charset="UTF-8" method="get">
<div class="form-group select required filter_discipline_id">
<select class="select required form-control" placeholder="Discipline" name="filter[discipline_id]" id="filter_discipline_id">
<option value="">- Discipline -</option>
<option selected="selected" value="1">HW</option>
<option value="2">SW</option>
</select>
</div>
<div class="form-group">
<input type="submit" name="commit" value="Filter" class="btn btn-default btn btn-primary form-control" />
</div>
</form>

<br /><hr /><br />

<div class="input-group">
<form class="simple_form form-inline" novalidate="novalidate" action="/dashboard/school" accept-charset="UTF-8" method="get">
<div class="form-group select required filter_discipline_id">
<select class="select required form-control" placeholder="Discipline" name="filter[discipline_id]" id="filter_discipline_id">
<option value="">- Discipline -</option>
<option selected="selected" value="1">HW</option>
<option value="2">SW</option>
</select>
</div>
<div class="form-group">
<input type="submit" name="commit" value="Filter" class="btn btn-default btn btn-primary form-control" />
</div>
</form>
</div>

生成 HTML 表单的 Ruby 代码:

<%= minimal_form_for :filter, url: @form_path, method: :get, html: {class: 'form-inline' } do |f| %>
<%= f.error_notification %>
<%= f.input :discipline_id,
collection: Discipline.all,
include_blank: '- Discipline -',
selected: params[:discipline_id] %>
<div class="form-group">
<%= f.button :submit, 'Filter', class: "btn-primary form-control" %>
</div>

看起来 simple_form 正在注入(inject)“btn”类。不确定如何阻止它。

最佳答案

你在哪里

<div class="form-group">
<input type="submit" name="commit" value="Filter" class="btn btn-default btn btn-primary form-control" />
</div>

替换为

<div class="form-group">
<input type="submit" name="commit" value="Filter" class="btn-primary form-control" />
</div>

无需多次调用这些类,在这种情况下,.btn 会导致您的问题

在你的 fiddle 上测试过,效果很好 ;)

关于css - Bootstrap 输入按钮未与其他字段对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34934156/

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