Jump to content

How can I add a button in accordion description?

Recommended Posts

22 hours ago, unINK said:

Site URL: https://northernresourcetrucking.squarespace.com/

Hi,

I am trying to add a button in accordion description. How is that possible?

You can add a text link, then add the following code to Home > Design > Custom Css

div.accordion-item__description p a {
  background-color: black;
  color: white !important;
  padding-left: 10px;
  padding-right: 10px;
  padding-top: 15px;
  padding-bottom: 15px;
  border-color: red;
  border-width: 1px;
  border-style: solid;
}

Get from @tuanphan 's solution: https://forum.squarespace.com/topic/207907-share-accordion-block-useful-code/

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 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
  • 1 year later...
On 6/29/2023 at 7:59 AM, mrb317 said:

What if a have items that need to be hyperlinked within the body of text that I don't want turned into a button?

Like this: image.png.6fad1e43e1fe54178273551f5bdab1d0.png

We can target exact url

Suppose your Checkout Our Groups has url: /check-out-our-groups

You can use this CSS code

div.accordion-item__description p a[href="/check-out-our-groups"] {
  background-color: black;
  color: white !important;
  padding-left: 10px;
  padding-right: 10px;
  padding-top: 15px;
  padding-bottom: 15px;
  border-color: red;
  border-width: 1px;
  border-style: solid;
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (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.