Answer the question
In order to leave comments, you need to log in
Is it possible to use flexbox and grid at the same time on the same page?
For example, in those moments (page elements) where flexbox does not cope, then use grids?
Answer the question
In order to leave comments, you need to log in
It is possible and necessary. Grid was not created to replace Flex. These are 2 different methods of building a layout, if roughly:
- Grid = 2D (arrangement of elements along 2 axes at the same time, horizontally and vertically)
- Flex = 1D (arrangement of elements only along the 1st axis, horizontally or vertically)
Even rougher - flex is good for "inline", aligning elements in the same row or column, usually specifically content elements, while grid is good for containers and more general elements (cards, etc.). That is, the general structure and layout were set by the grid, the content elements were placed with flexes inside the blocks.
And who's stopping you?))
The only problem is that IE does not support grids, because if there are rare perverts among the audience of your site, they may see the page incorrectly)
It is not possible, but it is necessary! Each method is good in its own way. Use floats, flexes, grids whenever it seems appropriate and optimal.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question