Is there a way to design a grid layout with 3 rows that will take up the entire screen, even if some of the rows are empty?
Let's say the header and footer are 100px and 50px respectively. The main area should occupy the rest of the screen.
.grid {
display: grid;
grid-template-columns: 1fr;
grid-template-rows: 100px auto 50px;
}
header {
grid-column: 1/2;
grid-row: 1/2;
background-color: bisque;
}
main {
grid-column: 1/2;
grid-row: 2/3;
background-color: chocolate;
}
footer {
grid-column: 1/2;
grid-row: 3/4;
background-color: darkolivegreen;
}
<body class="grid">
<header>
Header
</header>
<main>
Main
</main>
<footer>
Footer
</footer>
</body>
I have searched for similar questions but haven't found a suitable solution yet (I am still learning web designing).