I've 3-col layout, and it works fine when all col are scrollable. But if I want the left, and right ones to be fixed on top, my layout breaks.
I've seen many posts but nothing seems to work: How to disable vertical scroll in bootstrap column
I tried this, but my 3-col layout is gone when I set left, and right cols as fixed:
<div class="container">
<div class="row " style="margin-top:70px" >
<div class="col-sm-3 " style="position: fixed !important; " >
<div class="card ">
<!--Card image-->
<div class="view overlay">
<img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20%287%29.jpg" class="img-fluid" alt="">
<a href="#">
<div class="mask rgba-white-slight"></div>
</a>
</div>
<!--Card content-->
<div class="card-body">
<!--Title-->
<h4 class="card-title">Card title</h4>
<!--Text-->
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's
content.</p>
<a href="#" class="btn btn-primary">Button</a>
</div>
</div>
</div>
<div class="col-sm-6 " >
<div class="card ">
<!--Card image-->
<div class="view overlay">
<img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20%287%29.jpg" class="img-fluid" alt="">
<a href="#">
<div class="mask rgba-white-slight"></div>
</a>
</div>
<!--Card content-->
<div class="card-body">
<!--Title-->
<h4 class="card-title">Card title</h4>
<!--Text-->
<p class="card-text">Top #1 to build on the card title and make up the bulk of the card's
content.</p>
<a href="#" class="btn btn-primary">Button</a>
</div>
</div>
<br/>
<div class="card ">
<!--Card image-->
<div class="view overlay">
<img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20%287%29.jpg" class="img-fluid" alt="">
<a href="#">
<div class="mask rgba-white-slight"></div>
</a>
</div>
<!--Card content-->
<div class="card-body">
<!--Title-->
<h4 class="card-title">Card title</h4>
<!--Text-->
<p class="card-text">Top #2 to build on the card title and make up the bulk of the card's
content.</p>
<a href="#" class="btn btn-primary">Button</a>
</div>
</div>
</div>
<div class="col-sm-3 " style="position: fixed !important; " >
<div class="card ">
<div class="view overlay">
<img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20%287%29.jpg" class="img-fluid" alt="">
<a href="#">
<div class="mask rgba-white-slight"></div>
</a>
</div>
<div class="card-body">
<h4 class="card-title">Card title</h4>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's
content.</p>
<a href="#" class="btn btn-primary">Button</a>
</div>
</div>
</div>
</div>
</div>
I expected left, right col fixed (non scrollable), and the center-col scrollable.
When I use fixed-col I get wrong layout
And without fixed-col I get the expected layout (but it doesn't meet my requirement) layout-ok
Why the div col- doesn't force everything inside it to follow Bootstrap grid layout?