Last active
April 4, 2017 18:14
-
-
Save StressoID/6403ff915767f354acca11f91f8bebfa to your computer and use it in GitHub Desktop.
vertical 3 column flexbox grid
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> | |
<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> |
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
* { | |
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