I am facing a challenge where I need to perfectly center 3 col3 divs in a row. Despite the calculation showing 1.5, I am unsure of the proper method to overcome this hurdle.
<div class="row">
<div class="col-md-offset-2 col-md-3" style="height: 50px; background-color: red">
</div>
<div class="col-md-3" style="height: 50px; background-color: green">
</div>
<div class="col-md-3" style="height: 50px; background-color: orange">
</div>
</div>
Checkout the fiddle for reference: https://jsfiddle.net/DTcHh/25558/
The issue lies with the col-md-offset-2
as it leaves col-1
on the other end. If only there was a col-md-offset-1.5
, but unfortunately that is not an option :(
I attempted using paddings and margins, however, things started getting messy and seemed like I was heading in the wrong direction.
What is the correct way to center the 3 divs without resorting to any makeshift solutions?