My Sites


Sunday, July 5, 2015

Center a column using Twitter Bootstrap 3

http://stackoverflow.com/questions/18153234/center-a-column-using-twitter-bootstrap-3

https://shapebootstrap.net
http://www.wpfreeware.com/tutorial/outstanding-bootstrap-ecommerce-templates-free-premium/

The first approach uses Bootstrap's own offset classes so it requires no change in markup and no extra CSS. The key is to set an offset equal to half of the remaining size of the row. So for example, a column of size 2 would be centered by adding an offset of 5, that's (12-2)/2.
In markup this would look like:
<div class="row">
    <div class="col-md-2 col-md-offset-5"></div>
</div>

No comments:

Post a Comment