Last active
August 29, 2015 14:22
-
-
Save marisqaporter/65773be4f585eb324d90 to your computer and use it in GitHub Desktop.
Flexbox Use Case 1
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
.add-on { | |
/*ie9*/ | |
padding:0; | |
margin:10px; | |
float:left; | |
box-sizing:border-box; | |
/*end ie9*/ | |
background-color:#fff; | |
width:340px; | |
} | |
/*the child items set at a fixed width of 340 naturally flow | |
to 2 or 3 columns depending on screen size, but I want them to be full width at 600px */ | |
@media screen and (max-width:600px) { | |
.add-on { | |
width: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
.ukuu-addon-wrapper { | |
/*crazy, but you have to declare all the ms (for ie) values first, or they won't work*/ | |
display:-ms-flexbox; | |
-ms-flex-direction:row; | |
-ms-flex-align:stretch; | |
-ms-flex-wrap:wrap; | |
width: 100%; | |
display: -webkit-flex; /* Safari */ | |
display: flex; | |
padding:30px 0; | |
justify-content: space-around; | |
flex-flow:row wrap; | |
/*i'm pretty sure I put in float:left; only here because of ie9. It shouldn't be necessary for flex | |
items and has no meaning in flex.*/ | |
float:left; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment