1

我正在尝试使用 Bootstrap 3 在导航栏中制作下拉登录表单,但它看起来不太好 - 标签和输入比下拉...面板更宽。如何使用 col-* Bootstrap 类更改下拉表单宽度?

这是代码(http://getbootstrap.com/css/#forms-horizo​​ntal):

<ul class="nav navbar-nav navbar-right">
    <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Sign in <b class="caret"></b></a>
        <div class="dropdown-menu">
            <form class="form-horizontal" role="form">
                <div class="form-group">
                    <label for="inputEmail" class="col-lg-2 control-label">Email</label>
                    <div class="col-lg-10">
                        <input type="email" class="form-control" id="inputEmail" placeholder="Email">
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputPassword" class="col-lg-2 control-label">Password</label>
                    <div class="col-lg-10">
                        <input type="password" class="form-control" id="inputPassword" placeholder="Password">
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-lg-offset-2 col-lg-10">
                        <div class="checkbox">
                            <label>
                                <input type="checkbox"> Remember me
                            </label>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-lg-offset-2 col-lg-10">
                        <button type="submit" class="btn btn-default">Sign in</button>
                    </div>
                </div>
            </form>
        </div>
    </li>
</ul>

提前致谢。

4

1 回答 1

0

您可以添加填充.dropdown-menu并将列更改为col-lg-11

示例:http ://bootply.com/110118

于 2014-02-01T13:02:12.140 回答