I am currently in the process of developing a web application using Bootstrap 4. The main page should remain static without any scrolling, while the child panels should be able to scroll if their content exceeds the available space.
My goal is to achieve this effect similar to the image below, without relying on jQuery as shown in the demo: https://i.sstatic.net/DWJVi.png I am looking for a CSS solution, possibly using flexbox
If I remove the jQuery code, the div extends beyond the app area, causing unwanted scrolling as depicted in the following image: https://i.sstatic.net/iS6pd.png
I attempted to add the following styles to the red div:
max-height: calc(100% - 20px);
overflow-y: auto;
However, the percentage calculation did not work as expected. Using a fixed value like max-height: calc(210px - 20px);
does work but breaks when resizing the window.
Is there a straightforward (or complicated if necessary) way to achieve this layout purely with CSS?