Change the number of columns and rows in a grid as the number of items increase
问题 I have to design a responsive grid. The grid should change based on the number of items (instead of the size of the screen). From 5 to 6 items should be 2x3, from 7 to 9 items should be 3x3, from 10 to 12 items should be 3x4, from 13 to 16 items should be 4x4, and so on... Is this something I can do using CSS Grid? This is what I've tried: <main> <figure> <img src="https://placekitten.com/600/400" alt=""> </figure> <figure> <img src="https://placekitten.com/600/400" alt=""> </figure> <figure>