Created
March 15, 2014 19:32
-
-
Save LeaVerou/9572588 to your computer and use it in GitHub Desktop.
Flexbox playground
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
| /** | |
| * Flexbox playground | |
| */ | |
| body { | |
| margin: 0; | |
| display: flex; | |
| flex-flow: row; | |
| flex-wrap: wrap; | |
| align-content: stretch; | |
| align-items: stretch; | |
| } | |
| article { | |
| display: flex; | |
| flex: 1 1 50%; | |
| width: 50%; | |
| align-self: stretch; | |
| align-items: center; | |
| justify-content: center; | |
| box-sizing: border-box; | |
| } | |
| .dark { | |
| color: white; | |
| } | |
| body, html { height: 100% } |
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
| <article class="dark" style="background: red;">red</article> | |
| <article style="background: lime;">lime</article> | |
| <article class="dark" style="background: blue;">blue</article> | |
| <article style="background: aqua;">aqua</article> | |
| <article class="dark" style="background: fuchsia;">fuchsia</article> | |
| <article style="background: yellow;">yellow</article> | |
| <article class="dark" style="background: green;">green</article> | |
| <article class="dark" style="background: maroon;">maroon</article> | |
| <article class="dark" style="background: navy;">navy</article> | |
| <article class="dark" style="background: olive;">olive</article> | |
| <article class="dark" style="background: purple;">purple</article> | |
| <article class="dark" style="background: teal;">teal</article> | |
| <article style="background: white;">white</article> | |
| <article style="background: silver;">silver</article> | |
| <article class="dark" style="background: gray;">gray</article> | |
| <article class="dark" style="background: black;">black</article></section> |
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
| // alert('Hello world!'); |
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
| {"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment