Jump to content

Duplicating accordion custom icon code for another page.

Recommended Posts

Hey there!

So I am preparing a landing page within my current website. I used an amazing code provided by tuanphan to customize my homepage menu (icons for an accordion block) and tweaked it so it would only apply to the homepage's accordion block.

Here: https://www.thesoaresprotocol.com/

The issue now is that I would like to use custom icons for this new landing page's accordion blocks as well (2 of them), different icons on a different page.

The slug is: https://www.thesoaresprotocol.com/americaisazoo 

Here is the code I injected in Design>Custom CSS

/* Accordion icons before titles */
.homepage li.accordion-item .accordion-item__title:before {
    content: "";
    width: 20px;
    height: 20px;
    display: inline-block;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: bottom center;
}
li.accordion-item:nth-child(1) .accordion-item__title:before {
    background-image: url(https://i.ibb.co/vhMVb5q/chinese.png);
}
li.accordion-item:nth-child(2) .accordion-item__title:before {
    background-image: url(https://i.ibb.co/Vv3v3kP/chinese-1.png);
}
li.accordion-item:nth-child(3) .accordion-item__title:before {
    background-image: url(https://i.ibb.co/GT4ZBX1/electricity.png);
}
li.accordion-item:nth-child(4) .accordion-item__title:before {
    background-image: url(https://i.ibb.co/dB4ZkQp/chinese-new-year.png);
}

How could I customize the accordion blocks on this page as well?

Thank you for your help!

Edited by A1Protocol
Link to comment
  • Replies 1
  • Views 360
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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.