bootstrap 4 alpha 4和alpha 6之间形式的差异

时间:2017-01-10 20:48:49

标签: twitter-bootstrap bootstrap-4 twitter-bootstrap-4

我有以下代码:

<div class="card">
<div class="card-block">
    <form>
        <div class="form-group col-sm-6">
            <label for="visualTheme" class="control-label">Visual Theme</label>
            <div>
                <input class="form-control"
                       style="height:30px;width:250px" id="visualTheme" />
            </div>
        </div>
        <div class="form-group col-sm-6">
            <label for="startingScreen" class="control-label">Starting Screen</label>
            <div>
                <input class="form-control"
                       style="height:30px;width:250px" id="startingScreen" />
            </div>
        </div>
    </form>
</div>

使用B4 Alpha 4产生的东西是这样的: enter image description here

但是使用Alpha 6它看起来像这样:

enter image description here

这是我的 Fiddle

为什么即使有足够的空间将它们放在同一行上,它也会包装列?它与Alpha 4一样正确。

由于

1 个答案:

答案 0 :(得分:2)

col-*应始终放在row ..

<div class="card">
        <div class="card-block">
            <form class="row">
                <div class="form-group col-sm-6">
                    <label for="visualTheme" class="control-label">Visual Theme</label>
                    <div>
                        <input class="form-control" style="height:30px;width:250px" id="visualTheme">
                    </div>
                </div>
                <div class="form-group col-sm-6">
                    <label for="startingScreen" class="control-label">Starting Screen</label>
                    <div>
                        <input class="form-control" style="height:30px;width:250px" id="startingScreen">
                    </div>
                </div>
            </form>
        </div>
    </div>

http://www.codeply.com/go/MtjfuZpqti