I have several elements on a webpage that are designed to respond to screen size. There is always an even number of elements, and they are always the same in height and width, so when there are four of them, on the desktop screen each will be one quarter of the width of the screen. To distinguish elements for the viewer, I have their alternative color, for example:

When resizing the screen, my CSS automatically reduces the number of elements per line, moving them several lines. On a thin screen, it looks something like this:

, , , , , . : , , , , , , :

, , , . , : , , , , , ?
PHP, , . PHP, CSS JavaScript, , , .