I'm trying to center two columns that are inside one container:
<div class="container">
<div class="row">
<div class="col-md-5">
...
</div>
<div class="col-md-3">
</div>
</div>
</div>
but I'm getting all my divs at the left side. I know that both columns are taken 8 columns, So I'm missing 4 of them, But how can I ignore those 4 columns and just center my container? I know how to do this with simple css but I supose bootstrap handle this in a better way to make it responsive.
Try this:
<div class="container">
<div class="row">
<div class="col-md-5 col-md-offset-2">
...
</div>
<div class="col-md-3">
</div>
</div>
</div>
Since you have 4 columns extra, you need to move 2 columns from the left (col-md-offset-2).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With