Skip to content

Instantly share code, notes, and snippets.

@benknight
Created April 9, 2013 19:06
Show Gist options
  • Save benknight/5348457 to your computer and use it in GitHub Desktop.
Save benknight/5348457 to your computer and use it in GitHub Desktop.
Old flexbox will stretch to contain floats, while new flexbox won't (proper behavior).
/**
* Old flexbox will stretch to contain floats, while new flexbox won't (proper behavior).
*/
.flex-container {
display: -webkit-flex;
background: paleGreen;
}
.flex-container.old {
display: -webkit-box;
}
.flex-item {
-webkit-flex: 1;
}
.old .flex-item {
-webkit-box-flex: 1;
}
img {
float: left;
}
<div class="flex-container">
<div class="flex-item">
<img src="http://placehold.it/100x100">
Blah blah blah blah blah blah blah.
</div>
</div>
// alert('Hello world!');
{"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