Base avec grid-template-rows, variable...
Base avec grid-template-rows, variable, hauteur du header, de nav, main et footer, largeur des sections, bgc sur tous les éléments...
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Base full screen with Grid</title>
<style>
:root {
--sectionWidth: 1080px;
--headerHeight: 20vh;
--navHeight: 3vh;
--footerHeight: 15vh;
--header: rgb(115, 105, 145);
--headerSection: rgb(65, 65, 105);
--nav: rgb(40, 35, 55);
--navSection: rgb(15, 15, 35);
/* --navActive: #b5bfce; */
/* --navLink: #c2dafc; */
--main: rgb(135, 135, 135);
--mainSection: rgb(180, 180, 195);
--footer: rgb(45, 40, 50);
--footerSection: rgb(35, 35, 45);
--white: white;
}
body {
margin: 0;
min-height: 100vh;
/* background-color: #ababab; */
display: grid;
grid-template-rows: minmax(var(--headerHeight), auto) minmax(var(--navHeight), auto) 1fr minmax(var(--footerHeight), auto);
}
body > * > section {
max-width: var(--sectionWidth);
min-height: 100%;
margin: 0 auto;
}
body > header {
background-color: var(--header);
}
body > header > section {
background-color: var(--headerSection);
}
body > nav {
background-color: var(--nav);
}
body > nav > section {
background-color: var(--navSection);
}
body > main {
background-color: var(--main);
}
body > main > section {
background-color: var(--mainSection);
}
body > footer {
background-color: var(--footer);
}
body > footer > section {
background-color: var(--footerSection);
}
</style>
</head>
<body>
<header>
<section>
Header
</section>
</header>
<nav>
<section>
Navigation
</section>
</nav>
<main>
<section>
Content
</section>
</main>
<footer>
<section>
Footer
</section>
</footer>
</body>
</html>