I am trying to have two same size columns, in which I can have nested elements with big size, with overflow: scroll;
. But that col width is becoming 100%; What interesting, if I am adding small width to that column ( <div class="col" style="background:blue";width:100px;>), the problem is gone. Cols becoming 50%;
I am trying to understand why the column is getting 100% and how I can get desired result, but not adding width to column?
<div class="row">
<div class="col" style="background:blue">
<div style="overflow:scroll;">
<div style="width:10000px;">should be overflowed and 50%</div>
</div>
</div>
<div class="col" style="background:yellow">should be 50%</div>
</div>
2
Answers
You need to add the Bootstrap class
overflow-auto
to the column with a lot of content.See the snippet below.
Turning the row into a flexbox and setting the maximum width for the column might be an option.