<div class="grid__container">
<nav class="sidebar">Nav Content</nav>
<main class="content">
<article>Article Content</article>
<aside>Aside Content</aside>
</main>
</div>
<div class="warning">
<p>Subgrid support required to get the most out of this pen</p>
</div>
@import url("https://fonts.googleapis.com/css2?family=Exo:wght@600&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;
}
.warning {
position: fixed;
left: 0;
right: 0;
bottom: 0;
z-index: 2;
display: flex;
justify-content: center;
align-items: center;
padding: 0.5rem;
background-color: #fed7d7;
border-top: 1px solid #f56565;
padding: 10px;
color: #f56565;
}
@supports (grid-template-rows: subgrid) {
.warning {
display: none;
}
}
.grid__container {
height: calc(100vh - 8rem);
max-width: 1024px;
margin: 0 auto;
outline: 3px solid #111;
background: #333;
padding: 1rem;
}
.grid__container > * {
outline: 4px solid #111;
background: #557;
position: relative;
color: #fff;
padding: 10px;
}
.content {
padding: 0.5rem;
width: 100%;
}
.content > * {
outline: 3px solid #999;
background: #ccc;
position: relative;
color: #000;
text-shadow: 1px 1px 0 rgb(255 255 255 / 0.8);
padding: 10px;
}
.grid__container {
display: grid;
grid-template-columns: [nav-start] fit-content(200px) [nav-end content-start] 1fr 1fr [content-end];
grid-template-rows: [nav-start content-start] 1fr [nav-end content-end];
gap: 1rem;
}
.content {
grid-column: content-start / content-end;
grid-row: content-start / content-end;
display: grid;
grid-template-columns: subgrid [article-start] [article-end aside-start] [aside-end];
grid-template-rows: subgrid [article-start aside-start] [article-end aside-end];
}
article {
grid-column: article-start / article-end;
}
aside {
grid-column: aside-start / aside-end;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.