'random an infinite generated grid of pictures

I have some trouble with this web app I'm making, I need to make an infinite and random grid, but I don't know how to make it random, in that way that either its 2 imgs in a row or 1 big one, I have some pictures of the designer image description here enter image description here



Solution 1:[1]

Css can'not use random, But JS can use random.

this codesanbox code

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 edgefish