css - How to write this styling in latest implementation of CSS3's Flexbox -
i figured out how achieve style 2009 implementation of flexbox, there 2 other implementations. short-lived 2011 , part of 2012 syntax , current , final syntax.
how can write code in current , final implementation?
if can 2011 implementation, great!
i'm looking vendor-prefixes.
display:-moz-box; display:-webkit-box; display:box; -moz-box-align:center; -webkit-box-align:center; box-align:center; -moz-box-orient:horizontal; -webkit-box-orient:horizontal; box-orient:horizontal; -moz-box-pack:center; -webkit-box-pack:center; box-pack:center;
the complete set of properties this:
.foo { display: -webkit-box; display: -moz-box; display: -ms-flexbox; display: -webkit-flex; display: flex; -webkit-box-pack: center; -moz-box-pack: center; -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; -webkit-box-align: center; -moz-box-align: center; -ms-flex-line-pack: center; -webkit-align-content: center; align-content: center; -webkit-box-orient: horizontal; -moz-box-orient: horizontal; -webkit-box-direction: normal; -moz-box-direction: normal; -webkit-flex-direction: row; -ms-flex-direction: row; flex-direction: row; }
note row
/horizontal
default direction, , isn't necessary add unless you're overriding previous column
/vertical
declaration elsewhere.
setting flex container inline follows same naming conventions other inline properties (eg. inline-block, inline-table, etc.):
.foo { display: -webkit-inline-box; display: -moz-inline-box; display: -ms-inline-flexbox; display: -webkit-inline-flex; display: inline-flex; }
if you're doing vertical centering, firefox under 2009 implementation can problem because doesn't wrap properly. recommendation use different properties 2009 properties compared modern properties this:
http://codepen.io/cimmanon/pen/mxufa
li { text-align: center; vertical-align: middle; display: inline-block; display: -webkit-inline-box; display: -moz-inline-box; display: -ms-inline-flexbox; display: -webkit-inline-flex; display: inline-flex; /* vertical centering legacy, horizontal centering modern */ -webkit-box-pack: center; -moz-box-pack: center; -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; /* modern flexbox */ -ms-flex-align: center; -webkit-align-items: center; align-items: center; /* legacy flexbox */ -webkit-box-orient: vertical; -moz-box-orient: vertical; -webkit-box-direction: normal; -moz-box-direction: normal; }
Comments
Post a Comment