A
A
Alexander2018-04-03 11:17:51
css
Alexander, 2018-04-03 11:17:51

How to lay out the blocks in this order?

Greetings!
Tell me, the whole brain is broken.
There are 9 blocks. They should be in order as in the screenshot.
The height of the blocks in each line should be the same (and depend on the content). Now on the screen the height is the same for all blocks.
On mobile devices (let's say media{max-width:400px} ) all blocks should go one after another, in one column.
As I understand it, it is optimal to use Grid, but I do not have enough experience in them :)
vAWeoQBh1WBDKm.jpg

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
Lam Besis, 2018-04-03
@IIvanich

I managed to solve this problem through grids: link to codepen . It lines up in height, the order is observed, on a mobile phone they turn into a regular column.
As for browser support, grids have been in the specification for a long time, the simplest functions are already supported in 87% of browsers.

A
Andrew, 2018-04-03
@KickeRockK

Saw these 9 blocks and put order
in css . For desktop, set their width to 32%, in mobile - 100%.

A
A person from Kazakhstan, 2018-04-03
@LenovoId

https://codepen.io/topicstarter/pen/zWabjN?editors=1100 how to do without height limit don't know

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question