Is it appropriate to use grid layout and use it in production now (2018)?

< H2 > Preface < / H2 >

the front-end time to go out for the interview, because I wrote on my resume that I usually use the flex layout, and the interviewer asked me why I didn"t use the grid layout. At that time, I replied that it was because of compatibility, and then the interviewer asked me how different the compatibility of the two was. To be honest, I saw his compatibility in 17 years, when there were almost no browsers.

then I went back to check and found that the compatibility of grid is much better now, almost the same as flex , so I would like to ask if I can use grid when I use flex for production. It seems that it is rare to use grid for layout nowadays.

Mar.31,2021

for mobile devices, you can consider introducing grid. After all, the mobile phone is updated quickly and the browser compatibility problem is not so serious.
you ask this question as if flex and grid can only choose one of the two. They should be combined to give full play to their respective advantages, such as

.
  1. flex is perfect for centring (especially vertical centering) and for one-dimensional distribution of elements (how to distribute on a line).
  2. if it involves a two-dimensional (multi-row, multi-column) determined layout, use Grid.
  3. when it comes to responsive page elements, using flex + width percentage widths is simply too easy to use because of flex's natural streaming layout.

for the difference between the two, take a look at the article " CSS Ultimate Battle: Grid vs Flexbox ", which is well summed up

.
Menu