Jump to content

CSS help for colour gradient for a shape

Go to solution Solved by tuanphan,

Recommended Posts

Hello,

Most of my CSS is working and when I hit a hurdle, google usually helps me fix it. 

I have inputted a rectangle shapes (for testimonials) and I'd like these shapes to have a gradient background just like I've got in other areas of the site, and like I've done with the Title text of this Testimonial section, however nothing is working. 

Can you please let me know what I'm missing? Here's what I've tried for the left rectangle

#block-e46d08f8c549644763be
{
  background-color: #000000;
  background-image: linear-gradient(to right, #916437, #C19255, #E8C784) !important;
}
#block-e46d08f8c549644763be
{
    background: linear-gradient(to right, #916437, #C19255, #E8C784) !important;
}
#block-e46d08f8c549644763be
{
    background: transparent !important;
}

 

Thanks in advance

Screen Shot 2024-06-27 at 1.11.48 pm.png

Link to comment
Posted (edited)

Unfortunately, this has made no difference. Thanks for your time trying though. I believe it may be the site style colour hiding he css code? However it is my understanding that !important should prioritise the css over the generic site styles.

Edited by LibbyLee3
Link to comment

Thanks tuanphan, this worked for the background of the text block - however i had overlaid it over a shape so that the 3 shapes across the page will be identical. When I switch the block ID in your code to that of the shape, the gradient doesn't take effect. 

Link to comment
  • 1 month later...

Hii,

I'm very new to css but I tried using this code and it worked as a square but how can I modify this to work as a gradient background for a circle?

I tried writing radial instead of linear gradient but it didn't work.

This is what I tried:

div#block-c98fcaf51ea2e716288d {
    background-image: linear-gradient(to right, #DEDC00, #3AAA35, #008D36) !important;
}

Does anyone know how to make it work for a circle shape?

Thank you,

maia

Link to comment
On 8/22/2024 at 6:11 PM, maiale said:

Hii,

I'm very new to css but I tried using this code and it worked as a square but how can I modify this to work as a gradient background for a circle?

I tried writing radial instead of linear gradient but it didn't work.

This is what I tried:

div#block-c98fcaf51ea2e716288d {
    background-image: linear-gradient(to right, #DEDC00, #3AAA35, #008D36) !important;
}

Does anyone know how to make it work for a circle shape?

Thank you,

maia

Can you share link to page where you use this block? We can check easier

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.