SQSPStarter Posted August 13, 2022 Share Posted August 13, 2022 Site URL: https://www.becatalyst.us/ Hi Fellow Squarespacers, is there a way to add images to the default squarespace accordion? Become a contributor to the largest resource for Squarespace and gain recognition from thousands of visitors.Join us on this exciting journey. Ping us here!. Link to comment
izzyswebsite Posted August 14, 2022 Share Posted August 14, 2022 (edited) You could try the code below. It's not mine. It's from tuanphan. So thank him if it works for you. The link to the forum is below. https://forum.squarespace.com/topic/207907-share-accordion-block-useful-code/ /* Add an image into Accordion Content */ /* replace demo image with your image url */ /* nth-child(1) is first accordion item, nth-child(2) is second item... */ /* :before is image on top, :after if image on bottom */ li:nth-child(1) .accordion-item__description:before { content: ""; display: block; width: 100%; /* image width, you can also use px */ height: 150px; /* image height */ background-image: url(https://cdn.pixabay.com/photo/2021/09/15/15/48/seals-6627197__340.jpg); background-repeat: no-repeat; background-size: cover; margin-bottom: 20px; /* space between image-text */ } Edited August 14, 2022 by izzyswebsite Add link to forum with the code SQSPStarter 1 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