<div class="container">
<div class="row row-cols-4">
<div class="col">Column</div>
<div class="col">Column</div>
<div class="col-6">Column</div>
<div class="col">Column</div>
</div>
</div>
I thought the above code would have the same result as
<div class="container">
<div class="row row-cols-4">
<div class="col-2">Column</div>
<div class="col-2">Column</div>
<div class="col-6">Column</div>
<div class="col-2">Column</div>
</div>
</div>
But in fact it has the same result as
<div class="container">
<div class="row row-cols-4">
<div class="col-3">Column</div>
<div class="col-3">Column</div>
<div class="col-6">Column</div>
<div class="col">Column</div>
</div>
</div>
I don't understand why.
The documentation of .row-cols-* says
Use the responsive .row-cols-* classes to quickly set the number of columns that best render your content and layout.
So I thought:
row-cols-4
means 1 row shoud have 4<div class="col">
(orcol-*
).- The third div has
col-6
so its width would be 50% (6 out of 12) of the parent container. - The other 3
<div class="col">
equally share the remaining 50% width.
But the truth is the 4th div wraps, leaving the first 3 divs in the first line, among which the first 2 each occupies 25% of the horizontal space.
Can somebody help me reason about this? Have I misunderstood the meaning of row-cols-4
?