Keep in mind that when you use the col
class without any number or breakpoint, you are just telling the element to be a column and to use all the space available in the row; so if you put multiple col
classes the space is distributed equally for all of them, because of this the row doesn't wrap the elments, when you rezise the screen, the row just adjusts to it as well as the elements inside.
In order for the elements to wrap you have to be specific on the size of each column, so when that size does not fit in the row; then it will wrap into a new row, that what the col-*-*
classes do.
You should read how the grid system for bootstrap works here: https://getbootstrap.com/docs/4.3/layout/grid/
.col {
border: 1px solid black;
min-height: 50px;
}
.col-6 {
border: 1px solid black;
min-height: 50px;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" />
<div class="row">
<div class="col col1"></div>
<div class="col col2"></div>
<div class="col col3"></div>
<div class="col col4"></div>
<div class="col col5"></div>
</div>
<div class="row">
<div class="col-6 col-md-2 col1"></div>
<div class="col-6 col-md-2 col2"></div>
<div class="col-6 col-md-2 col3"></div>
<div class="col-6 col-md-2 col4"></div>
<div class="col-6 col-md-2 col5"></div>
</div>