D
D
doroshenko_magic2018-05-12 13:31:09
css
doroshenko_magic, 2018-05-12 13:31:09

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

4 answer(s)
I
Igor Vorotnev, 2018-05-13
@HeadOnFire

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.

A
Alexander, 2018-05-12
@pi4yyy

I think they are designed to be used where other tools fail.

S
SagePtr, 2018-05-12
@SagePtr

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)

A
Alexander Bukhalo, 2018-05-12
@evilsprut

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 question

Ask a Question

731 491 924 answers to any question