Jump to content

Add button class to a link

Go to solution Solved by tuanphan,

Recommended Posts

Hello,

On my Press Page I have a gallery, and in that gallery, I am adding a link to download each image in the gallery with HTML code. However, I would like the style of the "Download" button to be like other buttons on the website. 

This is the code that I have, but it is not working. Any clues?

<a class="sqs-block-button" href="https://images.squarespace-cdn.com/content/643730a61107da2b66f542b0/f3fb72d1-8abe-435b-8073-fcad7b9de423/a-thousand-pines-video-still-17.jpg" target="_blank"><strong>Download Video Still</strong></a>

https://quillfish-nectarine-3wnc.squarespace.com/
Password: atp2023!

Thanks in advance.

Link to comment
  • Solution

Add to Design > Custom CSS

p.gallery-caption-content a {
    color: var(--primaryButtonTextColor);
    background-color: var(--primaryButtonBackgroundColor);
    border-color: var(--primaryButtonTextColor);
    font-family: 'Brixton_Lead-Vector' !important;
    letter-spacing: .02em;
    font-size: 1.25rem;
    font-weight: 500;
    font-style: normal;
    text-transform: none;
    padding: 1.2rem 2.004rem !important;
    display: inline-block;
}

 

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

Also, I am looking to apply the site's button style to an accordion title that "shows more" text on my homepage (the site has been published here http://athousandpinesfilm.com/)

I achieved the look of the button using the code below but when the accordion text is expanded, the button lands on the middle of the text.

What would be a better practice for applying the style of my site's button to an accordion title?

Thanks!

.sqs-block-accordion .accordion-item__title-wrapper {
    color: var(--primaryButtonTextColor);
    background-color: var(--primaryButtonBackgroundColor);
    border-color: var(--primaryButtonTextColor);
  margin: 32px 0 0 0;
  top: 50%;
  left: 50%;
  transform: translate(-50% , -50%);
  position: absolute;
}

 

homepage-accordion-title.png

homepage-acoordion-text-with-button.png

Link to comment

Change your code to this

.sqs-block-accordion .accordion-item__title-wrapper {
    color: var(--primaryButtonTextColor);
    background-color: var(--primaryButtonBackgroundColor);
    border-color: var(--primaryButtonTextColor);
    margin: 32px 0 0 0;
    display: inline-block;
}
li.accordion-item {
    text-align: center;
}

 

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
On 4/28/2023 at 12:37 AM, AnaimationDesign said:

This works!, thanks! Would it be possible to change the "READ MORE" to "READ LESS" after the text is expanded? Thanks @tuanphan, you are the best!

A

Add this CSS

[aria-expanded="true"] span.accordion-item__title {
    font-size: 0;
}
[aria-expanded="true"] span.accordion-item__title:before {
    content: "READ LESS";
    font-size: 30px;
}

 

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.