Ask Question or Answer
You can ask your question or answer the question you know.
How to make two box side by side with bootstrap ?
i want to make two boxes side by side with bootstrap, please help me.
2 Answers on this Question
You can use .row and .col-sm-* classes to make boxes. There are other classes for a different resolution, .col-sm* will work on maximum 768 screen by Bootstrap 3. First, you need to know that there is 12 part = 100% so, try to understand the example below:
<div class="row">
<div class="col-sm-6" style="background:#060;">
50% Left box
</div>
<div class="col-sm-6" style="background:#600;">
50% right box
</div>
</div>
Here .col-sm-6 is 50% of width because 6 is half of 12. You can use 9 and 3 (9 + 3 = 12), like this you can use multiple columns too. But the sum of the class width must be 12.
Using flexbox is another option
<div class="container">
<div class="box box1">1</div>
<div class="box box2">2</div>
</div>
CSS style:
.container {
display: flex;
}
.box {
font-size: 200px;
}
Share on Social Media