如何调试twitter bootstrap v4-alpha网格? col-sm-offset- *不工作

时间:2016-03-17 10:36:39

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

我已经改变了某些地方,现在col-sm-offset-*根本没有改变。例如,如果我想将屏幕分成两半,并且仅在右侧显示内容,我通常会使用:

<div class="container">
    <div class="row">
        <div class="col-sm-6 col-sm-offset-6">
            This content isn't on the right hand side, it's on the left as if the col-sm-offset-6 isn't even there.
        </div>
    </div>
</div>

如何查看错误?

我正在使用NPM和Laravel Elixir(gulp)来缩小(准备生产)文件,而不是我在这里复制整个CSS文件,我不知道还能做什么。有什么明显的吗?有没有人遇到过这个?

更新

<div class="container">
    <div class="row">
        <div class="col-sm-6 col-sm-offset-6">
            <div class="row">
                <form role="form" method="POST" action="/register">
                    <input type="hidden" name="_token" value="abcdefghij">
                    <div class="col-xs-12">
                        <fieldset class="form-group">
                            <label for="username" class="form-control-label">Username</label>
                            <input name="username" type="text" class="form-control " id="username" placeholder="Enter a username" value="j">
                        </fieldset>
                    </div>
                    <div class="col-sm-6">
                        <fieldset class="form-group">
                            <label for="first_name" class="form-control-label">First Name</label>
                            <input name="first_name" type="text" class="form-control " id="first_name" placeholder="Enter your first name" value="John">
                        </fieldset>
                    </div>
                    <div class="col-sm-6">
                        <fieldset class="form-group">
                            <label for="last_name" class="form-control-label">Last Name</label>
                            <input name="last_name" type="text" class="form-control " id="last_name" placeholder="Enter your last name" value="Appleseed">
                        </fieldset>
                    </div>
                    <div class="col-sm-6">
                        <fieldset class="form-group">
                            <label for="email" class="form-control-label">Email Address</label>
                            <input name="email" type="email" class="form-control " id="email" placeholder="Enter your email address" value="j@a.com">
                        </fieldset>
                    </div>
                    <div class="col-sm-6">
                        <fieldset class="form-group">
                            <label for="password" class="form-control-label">Password</label>
                            <input name="password" type="password" class="form-control " id="password" placeholder="Enter a password" value="password">
                        </fieldset>
                    </div>
                    <div class="col-sm-6">
                        <fieldset class="form-group">
                            <label for="password_confirmation" class="form-control-label">Confirm Password</label>
                            <input name="password_confirmation" type="password" class="form-control " id="password_confirmation" placeholder="Please confirm your password" value="password">
                        </fieldset>
                    </div>
                    <div class="col-sm-6">
                        <div class="form-group">
                            <button type="submit" class="btn btn-primary pull-right">Register</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

Web Inspector

Web Inspector

CSS计算属性

CSS Computed Properties

更新2

我已经提交了issue on GitHub,因为这可能是故意的。

2 个答案:

答案 0 :(得分:2)

Bootstrap v4 Alpha的当前正确偏移类:

 class="col-md-6 offset-md-3"

答案 1 :(得分:0)

GitHub已经正式更改了他们的col-bp-offset-*名称,尽管文档目前已经过时。

查看问题:#19099#19368#19267和我自己的#19562

我会关闭这个问题并更新我的GitHub问题。