How to center a box on Twitter Bootstrap

css, twitter-bootstrap

Solution

If you are using bootstrap grid, then you can offset your columns:

<div class="row">
  <div class="span6 offset3">
     Your content goes here
  </div>
</div>

See example here: http://twitter.github.com/bootstrap/scaffolding.html#gridSystem

Or you can just use CSS to simply center block element,

div.login-box{
  margin:0 auto;
  width: 720px;
}

Problem

I'm laying out a login screen, and on that screen will be just a box with LOGIN and PASSWORD. I need to centralize vertically and horizontally (like any traditional login screen). How can I achieve this with Twitter Bootstrap? Thanks!

Original source