A Pen by James Hall on CodePen.
Created
May 4, 2020 22:57
-
-
Save eljamez/ae623daccdba51e833899b7a93c6c255 to your computer and use it in GitHub Desktop.
Quick Grid Page Layout
This file contains 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="grid"> | |
<header>Header</header> | |
<aside>Aside</aside> | |
<main>Main</main> | |
<footer>Footer</footer> | |
</div> |
This file contains 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
// Mobile first quick grid layout | |
@import url('https://fonts.googleapis.com/css2?family=Righteous&display=swap'); | |
.grid { | |
box-sizing: border-box; | |
font-family: 'Righteous', cursive; | |
background: linear-gradient(144deg, rgba(7,35,36,1) 0%, rgba(20,244,255,1) 100%); | |
display: grid; | |
height: 100vh; | |
color: white; | |
grid-template-columns: 1fr 2fr 1fr; | |
grid-template-rows: 100px 50px auto 50px; | |
grid-template-areas: | |
"header header header" | |
"sidebar sidebar sidebar" | |
"main main main" | |
"footer footer footer"; | |
/* Desktop */ | |
@media(min-width: 768px) { | |
grid-template-rows: 100px auto 50px; | |
grid-template-areas: | |
"header header header" | |
"sidebar main main" | |
"footer footer footer"; | |
} | |
> * { | |
padding: 20px; | |
text-transform: uppercase; | |
} | |
} | |
header { | |
grid-area: header; | |
background-color: rgba(0,0,0,.5); | |
} | |
aside { | |
grid-area: sidebar; | |
background-color: rgba(0,0,0,.7); | |
} | |
main { | |
grid-area: main; | |
background-color: rgba(0,0,0,.3); | |
} | |
footer { | |
grid-area: footer; | |
background-color: rgba(0,0,0,.5); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment