css3 - css flexbox equal height columns not working -
i trying css3 flexbox working (for first time) make equal height columns (for browsers support it).
i have seen various examples across web cant work.
here code (followed jsfiddle link)
<div> <span><p>a</p><p>a</p><p>a</p><p>a</p><p>a</p></span> <span>col2</span> <span>col3</span> </div> div { background:red; float:left; -webkit-display:flex; -moz-display:flex; display:flex; } span { display:block; background:yellow; float:left; width:100px; margin:0 10px; -webkit-flex:1; -moz-flex:1; flex:1; } any pointers appreciated.
the float causing entire thing fall apart in firefox. if need appear inline other content, you'll need use inline display property instead (inline-flex, inline-flexbox, inline-box).
when you're following modern flexbox draft, need stick of properties belong draft. if try mix , match, won't work expected. there 3 different drafts have been implemented in various browsers, each different property names and values (see: https://gist.github.com/cimmanon/727c9d558b374d27c5b6)
div { background: red; display: -webkit-box; display: -moz-box; display: -webkit-flexbox; display: -ms-flexbox; display: -webkit-flex; display: flex; } span { display: block; background: yellow; float: left; width: 100px; margin: 0 10px; -webkit-box-flex: 1; -moz-box-flex: 1; -webkit-flex: 1; -ms-flex: 1; flex: 1; }
Comments
Post a Comment