holahannah Posted May 30 Posted May 30 Hello, I'm trying to create a grid gallery, with portrait images, however each 5th image will be landscape, so I want it to take up 2 columns (see the design attached). I've tried to achieve the effect using the below code: .sqs-gallery-block-grid.sqs-gallery-thumbnails-per-row-3 .sqs-gallery-design-grid-slide:nth-child(5){ width: 66.66666667%; } .sqs-gallery-block-grid.sqs-gallery-thumbnails-per-row-3 .sqs-gallery-design-grid-slide:nth-child(6) { clear: left; } Which seems to half work. My issue is that the height on the 5th image is now too much (perhaps due to the aspect ratio of the gallery? Is there a way to ensure the 5th image has the same height has the row, and then in the next row, the images appear again in 3 columns? My site for reference: https://mcshanetest.squarespace.com/work/lava-kingston password: bandit Many thanks
tuanphan Posted June 1 Posted June 1 Some code like this to adjust image 5 .slide:nth-child(5) a { padding-bottom: 65% !important; } Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
holahannah Posted June 1 Author Posted June 1 Thank you @tuanphan, I added that code, which works great for the image height, but now i have a large gap after the 6th image, and the 7th image doesn't start until the next row (see screenshot attached). Any way to fix that so there are no gaps in the grid, and all the image sit next to each other? Thanks
Solution tuanphan Posted June 3 Solution Posted June 3 Add this code under div.slide:nth-child(7) { clear: none !important; } Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment