I've already looked at a few examples, but still can't seem to figure this one out... is there a way to fill the rest of the page with a div using Angular Material without using calc?
I've been able to get the bottom div to fill the rest of the page fine by using 'calc()` to determine the remaining height, but now the first column's height is subject to change (400px, 200px, 0px) so I need to find a way to do it without having to use calc.
My page setup is basically: navbar (fixed height), first column (height subject to change), second column (should fill the rest of the page - though content length is subject to change so should have scrollbar for content only on the content (excluding the headers) and not the entire div).
HTML:
<div layout="column" layout-fill>
<md-toolbar>
toolbar
</md-toolbar>
<div class="main">
<div style="height:100%" layout-fill>
<div flex layout="column" class="firstColumn">
<div class="header1">
first column header 1
</div>
<div class="header2">
first column header 2
</div>
<div>
first column content
</div>
</div>
<div flex layout="column" class="secondColumn">
<div class="header3">
second column header 1
</div>
<div class="header4">
second column header 2
</div>
<div>
second column content:
could be really really long, or really really short...
needs a scrollbar if long, and for the background to still fill the page if not long.
</div>
</div>
</div>
</div>
</div>
CSS:
.main {
height: calc(100%-64px);
}
.md-toolbar {
background-color: black;
height: 64px;
}
.firstColumn {
height: 200px;
background-color:green;
}
.secondColumn {
background-color:red;
}
.header1, .header3 {
height: 64px;
}
.header2, .header4 {
height: 28px;
}
Woking Code: JSFiddle