Trying to structure some CSS in order to create a website that resembles the layout of a typical desktop application:
Almost there, but struggling to make the scrollable panel stick to the bottom of the viewport and show a scrollbar instead of overflowing off the page.
The following is the HTML and CSS I currently have:
HTML
<nav></nav> <!-- Fixed height header -->
<aside></aside> <!-- Fixed height/width sidebar -->
<main><!-- Right content area container -->
<div class="top"></div> <!-- Right side top adjustable height panel -->
<div class="toolbar"></div> <!-- Fixed height toolbar -->
<div class="content"></div> <!-- Scrollable panel -->
</main>
CSS
nav {
width 100%;
height: 40px;
}
aside {
width: 260px;
position: absolute;
top: 40px;
bottom: 0;
}
main {
position: absolute;
left: 260px;
top: 40px;
bottom: 0;
right: 0;
}
.top {
position: relative;
right: 0;
left: 0;
min-height: 200px;
}
.toolbar {
height: 30px;
position: relative;
right: 0;
left: 0;
}
.content {
position: relative;
top: 0;
bottom: 0;
overflow: auto;
right: 0;
}
Although with the given CSS, the scrollable panel doesn't remain within the viewport as intended. Looking for a solution without JavaScript (as it's part of an Angular app and prefer not relying on JavaScript for positioning)