如何使面板体居中,输入标签与输入框的左侧对齐?

时间:2014-05-30 18:33:33

标签: html css twitter-bootstrap

Bootstrap:如何让面板体在中心对齐,但输入标签与输入文本框的左侧对齐?

<div class="panel panel-default">
    <div class="panel-body" align="center">
        <form role="form" id="password-form">

            <div class="form-group full-width">
                <label class="input-label" for="userId">Username <Id></Id>:</label>
                <div class="input-group min-width-400">
                    <input class="form-control" type="text"
                           id="userId"
                           name="userId"
                           required="true"/>
                </div>
            </div>
            <button id="closeBtn" type="button" class="btn btn-default">Cancel</button>
            <button id="resetBtn" class="btn btn-primary" type="button" style="width:150px">Reset Password</button>
        </form>
    </div>
</div>

1 个答案:

答案 0 :(得分:0)

如果我理解你,你正在寻找.panel-body {margin: 0 auto; width: xxx}而不是你的对齐属性..