likemindedproductions Posted October 16, 2022 Share Posted October 16, 2022 (edited) Site URL: https://openingnights.co.uk Example page in question: https://www.openingnights.co.uk/news/archive/sweet-mother-returns-to-stage-following-arts-council-england-funding-success Hi, I'm looking to limit the amount of items in a summary block on mobile If I have it set to 6 items for desktop, I only want to show 2 on mobile. Thank you for any help in advance Edited October 16, 2022 by likemindedproductions Unfinished question Link to comment
Solution paul2009 Posted October 16, 2022 Solution Share Posted October 16, 2022 17 minutes ago, likemindedproductions said: I'm looking to limit the amount of items in a summary block on mobile. If I have it set to 6 items for desktop, I only want to show 2 on mobile. As your Summary Block is showing 6 items on desktop, you'll want to hide the last 4 summary-items when the screen viewport (width) is less than 768px wide. You should be able to do this by adding the following to Design > Custom CSS: @media only screen and (max-width: 767px) { .sqs-block-summary-v2 { .summary-item:nth-last-child(-n+4) { display: none; } } } Notes: This will apply to all summary blocks on the website when being viewed on a mobile. The first line contains a media query that ensures the the CSS only applies when the page is viewed on a mobile (the screen is less than 768px wide). Setting Display to none hides the elements and removes the space that they would have occupied. The nth-last-child(-n+4) selector tells it to apply this setting to last 4 summary-items within the summary block. We like to know if our posts help. Please consider clicking a 'Like' or 'Thanks' icon below ⬇️ Florian and tanyacamp 2 Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional. Would you like your customers to be able to mark their favourite products in your Squarespace store? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment