两个输入字段彼此相邻的bootstrap 3

时间:2016-02-10 13:14:46

标签: twitter-bootstrap-3 asp.net-mvc-5 input-field

我是bootstrap的新手,并且在将两个输入字段放在一起时遇到问题。我在网上搜索过(和bootstrap.com),但无法找到anser。 The code

Result. But I need the input fields and button next to each other in one row

我尝试使用列...没有工作

2 个答案:

答案 0 :(得分:0)

您可以关注:Display two fields side by side in a Bootstrap Form

<div class="input-group">
<input type="text" class="form-control" placeholder="Start"/>
<span class="input-group-addon">-</span>
<input type="text" class="form-control" placeholder="End"/>

答案 1 :(得分:0)

您可以尝试以下代码

<div class="container content">
    <div class='row'>
        <form role="form" class="form-horizontal" method="post">
            <div class='col-xs-12 col-sm-4'>
                <div class="form-group">
                    <input class="form-control" name="" placeholder="Search from this date">
                </div>
            </div>
            <div class='col-xs-12 col-sm-4'>
                <div class="form-group">
                    <input class="form-control" name="" placeholder="Search till this date">
                </div>
            </div>
            <div class='col-xs-12'>
                <div class="form-group">
                    <button class="btn btn-primary">Search</button>
                </div>
            </div>
            <div class='col-xs-12'>
                <div class="form-group">
                    <a href="link">Back</a>
                </div>
            </div>
        </form>
    </div>
</div>