How to align two divs horizontally side by side center to the page using Bootstrap CSS?

Spread the love

To align two divs horizontally side by side center to the page using Bootstrap CSS, we set the col classes.

For instance, we write

<div class="container">
  <div class="row">
    <div class="col-xs-6">ONE</div>
    <div class="col-xs-6">TWO</div>
  </div>
</div>

to add the row class to create a row.

Then we add the col-xs-6 class to the inner divs to make the columns that takes half the width of the outer div when the breakpoint is xs or larger.

Leave a Reply

Your email address will not be published. Required fields are marked *