AbbyAbbyAbby Posted January 18, 2022 Posted January 18, 2022 (edited) Site URL: https://www.thecastingcompany.co.nz/our-work Hi community, Because gallery blocks can only display up to 30 items, I am using 2 x gallery blocks to display a large portfolio of work, inserted next to each other on one page. However, depending on the screen size or device a user is viewing the site on, the last row of the first gallery has gaps (it's fine if there is 1 column like on mobile, or 2 or 3 on desktop, but issues when there are 4 columns because its not divisible by 30). Is there code I can inject to ensure that no matter what screen size or device someone is using that the gallery blocks display the items as 1, 2, 3 or 5 items per row? Or that it has 3 columns on desktop and tablet and 1 column on mobile? Alternatively, code that restricts the gallery blocks from displaying 4 x items per row (or 4 columns) would be great. I have found some similar queries on the forum but nothing makes a change to my site. Thank you for any assistance you can share! Abby Edited January 19, 2022 by AbbyAbbyAbby
tuanphan Posted January 20, 2022 Posted January 20, 2022 Add to Design > custom CSS /* desktop tablet 3 items row */ @media screen and (min-width:641px) { body#collection-5fd7d2d420ec2014b412888d { .summary-item { width: 30.1205% !important; margin-bottom: 4.81928% !important; margin-right: 4.81928% !important; clear: none !important; } .summary-item:nth-child(3n) { margin-right: 0 !important; } .summary-item:nth-child(3n+1) { clear: left !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