Skip to content

Instantly share code, notes, and snippets.

@StressoID
Last active April 4, 2017 18:14
Show Gist options
  • Save StressoID/6403ff915767f354acca11f91f8bebfa to your computer and use it in GitHub Desktop.
Save StressoID/6403ff915767f354acca11f91f8bebfa to your computer and use it in GitHub Desktop.
vertical 3 column flexbox grid
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Flexbox Grid</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="flex-layout">
<header class="flex-element">1</header>
<main class="flex-element content">2</main>
<footer class="flex-element">3</footer>
</div>
</body>
</html>
* {
padding: 0;
margin: 0;
}
html, body {
height: 100%;
}
.flex-layout {
display: flex;
flex-direction: column;
width: 100%;
max-width: 760px;
height: 100%;
margin: 0 auto;
}
.flex-element {
flex: 0 0 auto;
}
main.flex-element {
flex: 1 1 auto;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment