Skip to content

Instantly share code, notes, and snippets.

@ScorpIan555
Created July 30, 2022 19:52
Show Gist options
  • Save ScorpIan555/0be14e9606597fcde870d04c19eed6cd to your computer and use it in GitHub Desktop.
Save ScorpIan555/0be14e9606597fcde870d04c19eed6cd to your computer and use it in GitHub Desktop.
grid_3
<div class="container">
<header>header</header>
<aside>Left</aside>
<section>Section</section>
<aside>Right</aside>
<footer>Footer</footer>
</div>
/* global reset */
* {
padding: 0px;
margin: 0px;
}
.container {
display: grid;
height: 100vh;
grid-gap: 10px;
grid-template-areas:
"header"
"section"
"right"
"left"
"footer";
grid-template-rows: 1fr 6fr 2fr 2fr 1fr;
}
aside:nth-of-type(1) {
grid-area: left;
}
aside:nth-of-type(2) {
grid-area: right;
}
section {
grid-area: section;
}
footer {
grid-area: footer;
}
header {
grid-area: header;
}
.container > * {
background: coral;
display: flex;
justify-content: center;
align-items: center;
}
@media (min-width: 500px) {
.container {
grid-template-areas:
"header header header"
"left section right"
"footer footer right";
grid-template-rows: 1fr 6fr 1fr;
grid-template-columns: 1fr 6fr 1fr;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment