Skip to content

Instantly share code, notes, and snippets.

@featheredtoast
Created February 22, 2018 16:03
Show Gist options
  • Save featheredtoast/54b96f7f716caf5f1669bfa62a6c7ca8 to your computer and use it in GitHub Desktop.
Save featheredtoast/54b96f7f716caf5f1669bfa62a6c7ca8 to your computer and use it in GitHub Desktop.
css grid demo
body {
margin: 0;
height: 100vh;
background-color: white;
display: grid;
grid-template-columns: 1fr 1fr 120;
grid-template-rows: 50px auto 20px;
grid-template-areas:
"header header header"
"secondary main sidebar"
"footer footer footer";
}
header {
background: pink;
grid-area: header;
}
main {
background: green;
grid-area: main;
}
div {
background: brown;
grid-area: secondary;
}
nav {
background: blue;
grid-area: sidebar;
}
footer {
background: red;
grid-area: footer;
}
<html>
<head>
<link rel="stylesheet" type="text/css" href="css-grid.css">
</head>
<body>
<header>
header welcome in
</header>
<nav>
nav elements~
</nav>
<main>
main content here yay
</main>
<div>
</div>
<footer>
footer
</footer>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment