Created
July 30, 2022 19:52
-
-
Save ScorpIan555/0be14e9606597fcde870d04c19eed6cd to your computer and use it in GitHub Desktop.
grid_3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
<header>header</header> | |
<aside>Left</aside> | |
<section>Section</section> | |
<aside>Right</aside> | |
<footer>Footer</footer> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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