Looking for some advice on my image gallery created using an ordered list. The issue I'm facing is that the images are not all the same size, causing the 4th and 7th images to disrupt the layout.
I have come up with a solution by using:
#wrapper li:nth-child(5n)
{
clear: left;
}
#wrapper li:nth-child(7n)
{
clear: left;
}
However, this approach will become cumbersome to maintain as more images are added to the gallery. Is there a better way to ensure that the images display without disrupting the flow of elements? Any suggestions would be greatly appreciated. Thank you!