Last active
July 13, 2016 10:34
-
-
Save oli/13e8786e17164dbed60ffa0cd002fe81 to your computer and use it in GitHub Desktop.
flexbox width test
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
/** | |
* flexbox width test | |
*/ | |
.ruler { | |
width: 984px; | |
height: 6px; | |
background-color: #888; | |
} | |
.container { | |
width: 983px; /* 983 - 2px (inter-box spacing) = 981 / 3 = 327px */ | |
} | |
.flexbox { | |
position: relative; | |
display: flex; | |
margin-top: 0.3em; | |
} | |
.box { | |
flex: 1 1 200px; | |
outline: 1px solid #ccc; | |
padding: 0.5em 0; | |
text-align: center; | |
margin-left: 1px; | |
} | |
.box:first-child { | |
margin-left: 0; | |
} |
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
<!-- content to be placed inside <body>…</body> --> | |
<div class="ruler"></div> | |
<div class="container"> | |
<div class="flexbox"> | |
<div class="box box1">box 1</div> | |
<div class="box box2">box 2</div> | |
<div class="box box3">box 3</div> | |
</div> | |
</div> |
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
// alert('Hello world!'); |
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
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment