David Gonzalez David Gonzalez - 2 months ago 7
CSS Question

Bootstrap responsive fixed width col that is always centered

I am trying to make a login page that has a fixed width while having column in the center of the page. Something like page :

https://www.amazon.com/sign-in


I have tried useing offset colms like this

<div class="col-md-4 col-md-offset-4" style=" float: none;
margin: 0 auto;">


Its not consistent size this way.

Answer

If it's a fixed-width DIV, you don't need Bootstrap's Grid. You just do:

<div style="width: 300px; margin: 0 auto;"></div>