0

I'm looking at the demo at in this post: https://stackoverflow.com/a/18717422/4147870

Is there a way to center the columns to the middle of the page as opposed to being aligned to the left as it is in the demo?

Community
  • 1
  • 1
user
  • 1,321
  • 3
  • 10
  • 11

1 Answers1

1

It's very easy to do. Use container rather than container-fluid. That example had an override for container-fluid that actually made it NOT fluid. If you remove the CSS you'll see that the content covers the space.

http://www.bootply.com/f0IoAp4e7J

<div class="container">
  <div class="row">
    <div class="col-xs-4">.col-4</div>
    <div class="col-xs-4">.col-4</div>
    <div class="col-xs-4">.col-4</div>
  </div>
  <hr>
</div>
Aibrean
  • 6,297
  • 1
  • 22
  • 38
  • What if there are only two columns and they are of different sizes? They become left aligned again http://www.bootply.com/qTyXoOD4U7 – user Dec 17 '14 at 16:52
  • 1
    As long as they equal 12 (the Bootstrap Grid) they will work fine. Otherwise use an offset value like http://www.bootply.com/MvqVtpb0Jq. – Aibrean Dec 17 '14 at 18:02