Skip to content

Instantly share code, notes, and snippets.

@A973C
Last active April 12, 2021 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save A973C/a4db635daf67a8b2619fd995c7ed6943 to your computer and use it in GitHub Desktop.
Save A973C/a4db635daf67a8b2619fd995c7ed6943 to your computer and use it in GitHub Desktop.
CSS Grid Layout
<header>header</header>
<nav>nav</nav>
<section>section</section>
<aside>aside</aside>
<footer>footer</footer>
body {
font-family: segoe-ui_normal,Segoe UI,Segoe,Segoe WP,Helvetica Neue,Helvetica,sans-serif;
display: grid;
grid-template-areas:
"header header header"
"nav section aside"
"footer footer footer";
grid-template-rows: 80px 1fr 50px;
grid-template-columns: 15% 1fr 18%;
grid-gap: 5px;
height: 100vh;
margin: 10px;
}
header {
background: #707070;
grid-area: header;
}
nav {
background: #C9BFBF;
grid-area: nav;
}
section {
background: #ABABAB;
grid-area: section;
}
aside {
background: #C9C9C9;
grid-area: aside;
}
footer {
background: #707070;
grid-area: footer;
}
header, nav, section, aside, footer {
padding: 5px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment