Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using flexbox, safe to use? Use it everywhere, anytime?

I have a question regarding the use of CSS flexbox. Flexbox feels like a game changer, it is so much more usable and quicker then using floats, positioning or javascript.

Cross-browser issues seem relative doable although I don't see flexbox used very often in the wild. I've seen it been released a couple years ago but because of browser issues never trusted it enough to use it in big projects.

Did anybody build a big, cross-browser project with it? Any tips or definitive guides to share?

like image 851
WIWIWWIISpitFire Avatar asked Jan 20 '17 09:01

WIWIWWIISpitFire


People also ask

Is it okay to use flexbox everywhere?

You could use flexbox on everything but you really shouldn't. Flexbox is a new layout algorithm for laying out complex web pages/applications, but he also have it disadventages(temporarily the most slower layout). Basically flexbox is the most best for smaller page components and UI elements.

What are the disadvantages of using flexbox?

Disadvantages. While flexbox is supported by most major browsers, it's still newer than the traditional box model. This means older browsers don't support it as well (some not at all). There are also more inconsistencies across different browsers.

Is it better to use grid or flexbox?

If you are using flexbox and find yourself disabling some of the flexibility, you probably need to use CSS Grid Layout. An example would be if you are setting a percentage width on a flex item to make it line up with other items in a row above. In that case, a grid is likely to be a better choice.

When should you use flexbox?

In a perfect world of browser support, the reason you'd choose to use flexbox is because you want to lay a collection of items out in one direction or another. As you lay out your items you want to control the dimensions of the items in that one dimension, or control the spacing between items.


1 Answers

It really depends on how far back you want to support Internet Explorer users. I would check out caniuse.com's compatibility chart for flexbox. It includes all the browsers that allow for flexbox in addition to the bugs that people encounter (particularly with IE10 and 11). http://caniuse.com/#feat=flexbox

Flexbox needs a minimum of IE10, but according to caniuse.com, the overall browser usage of IE8 + IE9 less than 1%, making it extremely low in terms of overall browser usage. I would say the only reason not to use flexbox is that if a certain percentage of your users are going to be governments/corporations, as they generally tend to be late with computer upgrades (increased likelihood of IE8 and 9 browsers).

like image 197
the12 Avatar answered Nov 10 '22 01:11

the12