Utilizing bootstrap version 5.2.3
I'm facing a challenge not with bootstrap itself, but rather my limited comprehension of the flex system and overflow.
Displayed below is a scenario where the first div
has a fixed height of 100vh
. My goal is to keep the navigation bar, main content, and footer visible at all times.
The container containing images needs to be scrollable, hence the use of the overflow: scroll
style. However, it appears to break out of its parent element, causing disruptions on the page layout. I suspect this issue may stem from the grid structure (utilizing the row
and col
classes).
<div class="vh-100 d-flex flex-column">
<div>
<h1>Navigation bar</h1>
</div>
<div class="flex-fill d-flex flex-column">
<h1>Main content</h1>
<div class="flex-fill d-flex flex-column">
<div class="row flex-fill">
<div class="col-6">
<p>&Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquam architecto consequuntur harum hic inventore laborum maiores necessitatibus nihil nobis officia optio perspiciatis quaerat quas quo reprehenderit rerum sequi, veritatis, vitae?</p>
</div>
<div class="col-6">
<div class="d-flex flex-column flex-wrap gap-2 overflow-scroll">
<div class="border" style="background-color: green; padding: 5px; margin: 5px;"><h5>Description</h5><img src="http://localhost:4545/blabla.png"></div>
...
</div>
</div>
</div>
<p>&Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsum itaque nemo placeat sed voluptatum! Adipisci beatae debitis deleniti dignissimos doloremque, doloribus eius facere illo in, nisi nostrum quia repudiandae sit!</p>
</div>
</div>
<div>
<h1>Footer</h1>
</div>
</div>