Last active
July 7, 2018 23:21
-
-
Save p410n3/48d037dfd7871e10a25f40023bd31374 to your computer and use it in GitHub Desktop.
My default CSS-Grid 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
body { | |
box-sizing: border-box; | |
margin: 0; | |
padding: 0; | |
} | |
.grid { | |
width: 100%; | |
min-height: 100vh; | |
display: grid; | |
grid-template-rows: 80px 1fr 120px; | |
grid-template-columns: minmax(10px, 1fr) minmax(0, 800px) minmax(10px, 1fr); | |
grid-template-areas: "header header header" | |
". content ." | |
"footer footer footer"; | |
} | |
.header { | |
grid-area: header; | |
background-color: blueviolet; | |
} | |
.content { | |
grid-area: content; | |
background-color: blue; | |
} | |
.footer { | |
grid-area: footer; | |
background-color: red; | |
} |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>GRID-CSS MAGIC</title> | |
<link rel="stylesheet" href="css/grid.css"> | |
<link rel="stylesheet" href="css/style.css"> | |
</head> | |
<body> | |
<div class="grid"> | |
<div class="header"> | |
<h2>header</h2> | |
</div> | |
<div class="content"> | |
<h2>content</h2> | |
</div> | |
<div class="footer"> | |
<h2>footer</h2> | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment