I was trying to get 2 columns side by side in tablet size while so I wrote col-md-6 so that each column will use only 6 units,but as soon as I shift from desktop size to tablet size the columns get stacked vertically with each column using all 12 units.In fact there is the same issue while viewing in mobile mode and col-sm-4 also stacks columns vertically. Please help.
<div class="row">
<div class="col" style="background-color:red;border:1px solid">
col
</div>
<div class="col" style="background-color:red;border:1px solid">
col
</div>
</div>
<div class="row">
<div class="col-md-6" style="background-color:green; border:1px solid">
col-md-6
</div>
<div class="col-md-6" style="background-color:green; border:1px solid">
col-md-6
</div>
</div>