I need to implement a grid formation as follows:
+-------------------+ +--------+ +--------+
|1 | |2 | |4 |
| | | | | |
| | | | | |
| | | | | |
| | +--------+ +--------+
| |
| | +--------+ +--------+
| | |3 | |5 |
| | | | | |
| | | | | |
| | | | | |
+-------------------+ +--------+ +--------+
+--------+ +--------+ +--------+ +--------+
|6 | |7 | |8 | |9 |
| | | | | | | |
| | | | | | | |
| | | | | | | |
+--------+ +--------+ +--------+ +--------+
Where the size of 1 is 2x the size of the other items (images) + margin. Also if the viewport
is big enough, 6 and 7 should fall back next to 4 and 5. Ideally there would be a clean solution that would not involve having to wrap the elements into containers
and/or no JavaScript
, but I'm interested in hearing all the possible solutions.
P.S. Flexbox
is out of question for my use case because of browser support, but I'm still interested in hearing possible solutions made with it.
P.P.S. 3 and 4 can swap places, but ideally they'd be in that order.