Last active
May 18, 2017 10:02
-
-
Save willwright82/cd6a35ce707338b06b36299871a9114b to your computer and use it in GitHub Desktop.
Simple responsive flexbox grid
This file contains hidden or 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
| <style type="text/css" media="all"> | |
| body { | |
| margin: 0; | |
| } | |
| .container { | |
| display: flex; | |
| flex-direction: column; | |
| justify-content: space-between; | |
| } | |
| .flex-grid { | |
| display: flex; | |
| flex-direction: column; | |
| align-items: stretch; | |
| height: 100%; | |
| } | |
| .col { | |
| flex: 1; | |
| padding: 15px; /* Styling */ | |
| } | |
| footer { | |
| align-self: stretch; | |
| padding: 15px; /* Styling */ | |
| background: lightgrey; /* Styling */ | |
| min-height: 70px; /* Styling */ | |
| } | |
| @media (min-width: 600px) { | |
| .container { | |
| height: 100vh; | |
| } | |
| .flex-grid { | |
| flex-direction: row; | |
| } | |
| } | |
| </style> | |
| <div class="container"> | |
| <div class="flex-grid"> | |
| <div class="col"></div> | |
| <div class="col" style="background: lightblue;"></div> | |
| <div class="col"></div> | |
| </div> | |
| <footer></footer> | |
| </div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment