Created
March 17, 2015 12:23
-
-
Save kaskajp/765a4846e3ee3c5ad888 to your computer and use it in GitHub Desktop.
Responsive Flexbox Example
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
<div class="container"> | |
<div class="image"> | |
<img src="http://placetokyo.com/100/100" alt="" /> | |
</div> | |
<div class="name-location"> | |
<div class="name">This be the name</div> | |
<div class="location">This be the location</div> | |
</div> | |
<div class="buttons"> | |
<a href="#">Button</a> | |
<a href="#">Second button</a> | |
</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
.container { | |
border: 1px solid rebeccapurple; | |
display: flex; | |
align-items: center; | |
justify-content: space-between; | |
} | |
.image { | |
border: 1px solid gold; | |
width: 100px; | |
flex: 0 0 100px; | |
} | |
.image img { | |
display: block; | |
} | |
.name-location { | |
border: 1px solid hotpink; | |
flex: 1 1 auto; | |
} | |
.buttons { | |
border: 1px solid orangered; | |
} | |
@media screen and (max-width: 600px) { | |
.container { | |
border-width: 2px; | |
flex-wrap: wrap; | |
} | |
.buttons { | |
padding: 40px 0; | |
flex: 1 100%; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment