twitter-bootstrap-3 – Typeahead js打破bootstrap内联形式

前端之家收集整理的这篇文章主要介绍了twitter-bootstrap-3 – Typeahead js打破bootstrap内联形式前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有这样的形式:

<form role="form" class="form-inline" name="frmUserData" id="frmUserData">
    <div class="form-group">
        <label for="txtlitm">Item Code:</label>
        <input type="text" class="form-control" id="txtlitm" name="txtlitm" autocomplete="off">
    </div>
    <div class="form-group">
        <label for="txtmcu">Branch Plant (filter):</label>
        <input type="text" class="form-control" id="txtmcu" name="txtmcu">
    </div>
    <div class="form-group">
        <label for="txtlocn">Location (filter):</label>
        <input type="text" class="form-control" id="txtlocn" name='txtlocn'>
    </div>
    <div class="form-group">
        <button type="button" class="pull-left btn btn-default" id="btnGO">
            Search
        </button>
    </div>
</form>

在我启用typeahead.js之后看起来像这样:

PIC LINK

项目代码标签未与文本框对齐,与其他字段对齐.

我该怎么办才能解决这个问题?

解决方法

Typeahead.js将“vertical-align:top”设置为输入元素,这会导致您的问题(请参阅typeahead.bundle.js中的第753行和第758行)

您可以在JS中更改它或通过CSS覆盖它:

.form-inline .form-control {
    vertical-align: middle !important;
}

猜你在找的Bootstrap相关文章