4 ms·
That might have been true in 2006 but we now have reasonable support cross-browser for Flexbox[1] (especially if you reduce the pain with autoprefixer[2]), and
by robin_reala 12y ago
That might have been true in 2006 but we now have reasonable support cross-browser for Flexbox[1] (especially if you reduce the pain with autoprefixer[2]), and CSS Grid Layout[3] is coming.
[1] http://www.w3.org/TR/css3-flexbox/ http://www.w3.org/TR/css3-flexbox/
[2] https://github.com/postcss/autoprefixer https://github.com/postcss/autoprefixer
[3] http://www.w3.org/TR/css3-grid-layout/ http://www.w3.org/TR/css3-grid-layout/
- rmc 12y agoSo it only took 20 years...
- brandonbloom 12y ago...and it's more complicated and less capable.
- deleted 12y ago[deleted]
- cookiecaper 12y agoWhile you're right that the current versions of all browsers seem to support it now (though Safari still requires prefixing), it's pretty recent on some of these: http://caniuse.com/#search=flex http://caniuse.com/#search=flex. Most people still won't feel comfortable using it for probably another year or so, and this is just one element in the Flexbox specification; it doesn't necessarily imply the rest is well-supported or that implementations are reasonably consistent across browsers.
- robin_reala 12y agoOK, fair points, but if the OP can look back 8 years and apply that to now then I reserve the right to look forwards 8 years and do the same :)
- acdha 12y agoIt is recent but I'm seeing >85% of visitors to non-technical sites using a browser which supports flexbox. At that point, using something like a CSS preprocessor to manage the prefixing / older spec support and deploying flexie for older versions of Internet Explorer starts looking like a very reasonable prospect. If your goal is simply to do vertical centering, align elements with consistent sizing, or have the ability to reorder elements in different contexts without having to change the DOM order, flexbox works well in all of the browsers listed at http://caniuse.com/#feat=flexbox http://caniuse.com/#feat=flexbox. That said, it is something of a travesty that one of the most popular reasons to dive down that particular rabbit hole in 2014 is to get real vertical centering: https://gist.github.com/acdha/a91a46706de02c37566a https://gist.github.com/acdha/a91a46706de02c37566a is still 11 lines for one of the most basic layout requirements.
- Touche 12y agoAm I the only one who finds flexbox incredibly complicated? It probably covers every possible scenario but doing some simple thing takes me 15 minutes of trial and error to get right.
- archagon 12y agoI'm no CSS expert, but I personally find it incredibly easy and intuitive compared to the usual CSS alignment nonsense. Floats? Table display? Inline block? Flexbox is the first CSS layout feature that makes me feel like I don't have to harness an army of hacks to get anything done.
- andrewingram 12y agoThere are still layouts it can't solve, for which I'm using Javascript to manually calculate the size of elements
- Bahamut 12y agoThere's a learning curve, but it isn't as fragile as the set if margin and position hacks that were standard before. Those old hacks are still used for supporting old browsers (IE8 and before), but flexbox simplifies things once you grasp it in applications.
- biscarch 12y agoI find it no more complicated than things such as figuring out things like clearfixes were in the beginning.
- chc 12y agoI would say the opposite: After a small initial hump, flexbox is actually very simple for what it gives you, but it's ultimately fairly limited. It's not up to implementing every kind of grid layout cleanly, and it's not even in the same ballpark as constraint-based layouts.