关于bootstrap form-inline的输入

时间:2015-10-14 09:20:56

标签: twitter-bootstrap

            <div class="form-group form-inline">
            <label class="col-sm-1 control-label no-padding-right">A :</label>
            <input type="text" name="a1" class="form-control" id="a1">
            ~
            <input type="text" name="a2" class="form-control" id="a2">
            </div>
            <div class="form-group form-inline">
            <label class="col-sm-1 control-label no-padding-right">B :</label>
            <input type="text" name="b1" class="form-control" id="b1">
            ~
            <input type="text" name="b2" class="form-control" id="b2">
            </div>

我希望输入框为:enter image description here

1 个答案:

答案 0 :(得分:0)

我认为这是你真正需要完成的事情:

            <div class="form-inline">
                <div class="form-group form-inline">
                    <label for="a1" class=" control-label no-padding-right">A :</label>
                    <input type="text" name="a1" class="form-control" id="a1">
                    ~
                    <input type="text" name="a2" class="form-control" id="a2">
                </div>
                <div class="form-group">
                    <label for="b1" class="control-label no-padding-right">B :</label>
                    <input type="text" name="b1" class="form-control" id="b1">
                    ~
                    <input type="text" name="b2" class="form-control" id="b2">
                </div>
            </div>

小提琴:http://jsfiddle.net/jo69e0op/