How to center form in twitter bootstrap?

后端 未结 6 853
悲&欢浪女
悲&欢浪女 2020-12-08 21:11
6条回答
  •  被撕碎了的回忆
    2020-12-08 22:12

    Both answers posted are valid and work so I upvoted them. Here is another method i did not see posted.

    You can center your form by setting it to display:inline-block and center it within the .center container using text-align:center. This way the form will center regardless of width within that container:

    CSS

    .center {
        text-align:center;
    }
    
    .center form {
        display:inline-block;
    }
    

提交回复
热议问题