2

Hello guys I am trying to center 3 divs in bootstrap but I wasn't successful.

The only time when it worked was only when I used 3 <div class="col-md-4"> but I wanna do a 3 div of col-md-3 and center them horizontal.

After doing some research the only solution that I fond was to use col-md-offset but it doesn't center my div properly. The right space is bigger then the left one.

Here is my code and thanks for the help:

<div class="container">
<div class="col-md-3 col-md-offset-2">
</div>
<div class="col-md-3">
</div>
<div class="col-md-3">
</div>

If there is any other alternative that I can use rather then using bootstrap please share it with me, I would also prefer to see a working example on how to center 3 divs horizontal in the middle of the page.

thanks for the help

kiranvj
  • 32,342
  • 7
  • 71
  • 76
  • 2
    Possible duplicate of [How to center Bootstrap columns when they are an odd number?](https://stackoverflow.com/questions/28683329/how-to-center-bootstrap-columns-when-they-are-an-odd-number) – APAD1 Jun 15 '17 at 17:02
  • 3
    Possible duplicate of [Center a 9-column layout using twitter bootstrap 3](https://stackoverflow.com/questions/27224650/center-a-9-column-layout-using-twitter-bootstrap-3) – hungerstar Jun 15 '17 at 17:05

1 Answers1

0

You can simply add them inside of another div then for that div use display:inline-block which will make its width smaller so only those 3 col-md-3 fit and then just Center align that wrapping div using text-center class on its parent