Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Centering .col-md-x on bootstrap

How could I center the .col-md-8 (http://getbootstrap.com/css/#grid-example-basic) on bootstrap valid html?

like image 222
Zoker Avatar asked Nov 11 '13 21:11

Zoker


2 Answers

You can use the class col-md-offset-2. Or you can create a div inside of your column div and use a class of content-center. Hope this helps.

like image 171
zach57 Avatar answered Oct 19 '22 02:10

zach57


You can use the Bootstrap class .mx-auto.

<div class="row">
    <div class="col-md-8 mx-auto">
        <p>Content with 8 columns in md</p>
    </div>
</div>
like image 5
David Jesus Avatar answered Oct 19 '22 04:10

David Jesus