I have been using the code mentioned below, it works on my Chrome but not on my IE9 and Safari.
I googled for the solution, despite I got various vendor prefixes, those results are baffling me.
<div style="display: flex; flex-direction: row;">
<div></div>
<div></div>
</div>
I would suggest reading the spec to fully understand: http://dev.w3.org/csswg/css-flexbox/
For the visually minded @chris-coyier has recently revamped his post w/ help from (@hugo-giraudel):http://css-tricks.com/snippets/css/a-guide-to-flexbox/
code sample:Live(credit to @chris-coyier just can't find original post so remade): http://cdpn.io/oDxnp
compiled out put would look like this
display: flex; =>
flex-direction: row; =>
CSS Flexbox model is optimised for UI Design. It is developed primarily to avoid overflowing parent element. It will shrink children when ancestor element size is constricted. It will fill the space by expanding child element's size when ancestor element size extends. Flex container shrink and expand behaviour can break with min and max width / height property.
CSS FlexBox versions by version
W3 2009 : display: box;
W3 2011 : display flexbox | inline-flexbox
W3 2012 : display flex | inline-flex
To cover all Flexbox implementations, your CSS would look like this:
Note, however, that specifying
flex-direction: row
is not necessary unless you're overriding a previous flex-direction declaration: row is the default direction. Also note that IE10 is the first version of IE to support Flexbox.IE9-, unfortunately, doesn't support Flexbox at all. IE10 supports the 2011 version.
Opera 12.1+ supports the latest 2012 version unprefixed. It will also be supported by Chrome 30+ and IE11+. Firefox 22 already supports it, too, but only partially — it doesn't support flex-wrap property and flex-flow shorthand.
Previous versions of Firefox, Chrome, and Safari 3.1+ support 2009 version. Chrome 21+ also supports 2012 version with prefix.
My Flexbox css: I have tested on serveral devices from Android 2.3.3 and IOS and works ok: