Jump to content

Adding multiple images inside accordian block

Recommended Posts

Hi- I'm trying to add multiple images in the drop down description area of the accordian block. I need to add anywhere between 2 -8 depending on the line item. I was able to add only one image using this code- but this won't work for my needs. Thank you!:

/* 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... */

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 */

}

Link to comment
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

22 hours ago, Tinyhammer said:

Hi- I'm trying to add multiple images in the drop down description area of the accordian block. I need to add anywhere between 2 -8 depending on the line item. I was able to add only one image using this code- but this won't work for my needs. Thank you!:

/* 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... */

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 */

}

Can you share your site with the protected password so I can take a look?

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date format)
💫 Animated Buttons (Referral URL)
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.