如何在bootstrap中心形式3 [英] How to center form in bootstrap 3

查看:178
本文介绍了如何在bootstrap中心形式3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何确定登入表单的中心位置?

How can I center my login form ? I'm using bootstrap column but it's not working.

这是我的代码:

<div class="container">
    <div class="row">
        <div class="col-md-4 col-md-offset-6">
            <h2>Log in</h2>   
            <div>
                <table>
                    <tr>
                        <td>1</td>
                        <td>1</td>
                    </tr>
                    <tr>
                        <td>2</td>
                        <td>2</td>
                    </tr>
                    <tr>
                        <td>3</td>
                        <td>3</td>
                    </tr>
                 </table>
             </div> 
        </div>
    </div>
</div>


推荐答案

一个简单的方法是添加

.center_div{
    margin: 0 auto;
    width:80% /* value of your choice which suits your alignment */
}


$ b b

到你的类 .container .Add width:xx%

例如:

<div class="container center_div">

但我觉得默认情况下 container 以BS!

but i feel that by default container is centered in BS!

这篇关于如何在bootstrap中心形式3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆