Flexbox vs grid

Flexbox and grid do not compete: they complement each other. The useful question is not which is better, but what leads in each case, the content or the structure.
Featureflexgrid
DimensionsOne: row or columnTwo: rows and columns at once
ApproachContent defines the sizeStructure defines the size
Alignment across linesEach line is independentColumns line up across rows
OverlappingNeeds position or negative marginsNative, by sharing cells
Typical useBars, menus and button groupsPages, galleries and dashboards

Example

With the same HTML, compare both systems. In flex, items on the last line grow to fill it; in grid, they respect the columns of the previous rows.

Select system:
ResultLive
html
css