<div class="grid__container">
  <header>Header Section</header>
  <nav>Nav Section</nav>
  <main class="grid__container--subgrid">
    <header>Sub Header Section</header>
    <nav>Sub Nav Section</nav>
    <main>Sub Main Section</main>
    <aside>Sub Sidebar Section</aside>
    <footer>Sub Footer Section</footer>
  </main>
  <aside>Sidebar Section</aside>
  <footer>Footer Section</footer>
</div>
@import url("https://fonts.googleapis.com/css2?family=Exo:[email protected]&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  width: 100vw;
  min-height: 100vh;
  font-family: "Exo", Arial, sans-serif;
  background-color: #557;
  padding: 4rem 0;
}

.grid__container {
  height: calc(100vh - 8rem);
  max-width: 1024px;
  margin: 0 auto;
  outline: 3px solid #111;
  background: #333;
  color: #fff;
  text-align: center;
  font-size: 1.2rem;

  display: grid;
  grid-template-columns:
    [header-start nav-start footer-start] fit-content(100px)
    [nav-end main-start] 1fr [main-end aside-start] fit-content(100px)
    [header-end aside-end footer-end];
  grid-template-rows: [header-start] 80px [header-end nav-start main-start aside-start] 1fr [nav-end main-end aside-end footer-start] 60px [footer-end];
  grid-template-areas:
    "header header header"
    "nav    main   aside"
    "footer footer footer";
  padding: 1rem;
  gap: 1rem;
}
.grid__container * {
  outline: 4px solid #111;
  background: #557;
  position: relative;
}

header {
  grid-area: header;
}

nav {
  grid-area: nav;
}

main {
  grid-area: main;
}

aside {
  grid-area: aside;
}

footer {
  grid-area: footer;
}

.grid__container--subgrid {
  display: inherit;
  grid-template-columns: inherit;
  grid-template-rows: inherit;
  grid-template-areas: inherit;
  gap: inherit;

  padding: 0.5rem;
  width: 100%;
  font-size: 1rem;
}

.grid__container--subgrid > * {
  outline: 3px solid #999;
  background: #ccc;
  position: relative;
  color: #000;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.