Valued Posted June 11 Share Posted June 11 I found code on another post that can add a single image to an accordion tab, however it does not allow for multiple. How can I add more than one image to a single tab? This is the code I am referencing: /* 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 */ } Beyondspace 1 Link to comment
creedon Posted June 11 Share Posted June 11 CSS can only add a limited number images. Too potentially add several images would require JavaScript and the business plan or above. I know of no code that currently does this. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. 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