Jump to content

Custom CSS - Change color of specific button

Go to solution Solved by tuanphan,

Recommended Posts

Hi there,

I am trying to change the color of only one specific button on my website. There are three buttons with a background color of #333 in this specific section, and I would like to change the color of the first button to some other shade of grey.

I have looked at the code in the chrome devtools and identified the element. I tried "grabbing" it with the elements ID and the class and using something like :first-child but I can't seem to find the first button only. I always end up changing the color of them all.

Can someone point out to me what I might do wrong here?

Tanks in advance!

Screenshot.png

Edited by pale
Specified title
Link to comment
  • pale changed the title to Custom CSS - Change color of specific button
  • 11 months later...

Hi, this solution seems to be what I'm looking for.  But I'm assuming "div#block-1a120f1d30f77a99311a" references a unique identifier for the block on that webpage.  How do I identify the block ID I want to change on my website?  TIA!

Link to comment
23 hours ago, jules75 said:

Hi, this solution seems to be what I'm looking for.  But I'm assuming "div#block-1a120f1d30f77a99311a" references a unique identifier for the block on that webpage.  How do I identify the block ID I want to change on my website?  TIA!

You can use this free tool to find Button Block ID

https://chromewebstore.google.com/detail/squarespace-id-finder/igjamfnifnkmecjidfbdipieoaeghcff

Just install it > Click tool icon on browser >> It will show all IDs on current page.

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
  • 3 weeks later...
On 6/29/2023 at 5:11 AM, tuanphan said:

Add to Design > Custom CSS

/* Shop Calendar Button */
div#block-1a120f1d30f77a99311a a {
    background-color: #f1f !important;
}

 

Is it possible to change the button color per data section? 

section[data-section-id="658a705f2ad1055baaa1f359"]

Link to comment
On 7/10/2024 at 2:21 AM, pipes said:

Is it possible to change the button color per data section? 

section[data-section-id="658a705f2ad1055baaa1f359"]

Use code like this

section[data-section-id="658a705f2ad1055baaa1f359"] .button-block a {
	background-color: #f1f !important;
}

 

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.