Jump to content

Change Opacity of Gradient ONLY not Text

Go to solution Solved by Web_Solutions,

Recommended Posts

Hi All! I am in the process of rebuilding my website and have solid gradients that each appear over an image upon hovering, I've lowered the opacity of the gradient (opacity .4) for my desired look on each but the problem is that it is also affecting the text that is on top of the gradient. I would like only the gradient opacity to be lowered and the text to stay at full opacity. Is there a way to add custom css so that when I lower the opacity of the gradient it does not affect my text on top of it? Any help would be appreciated! Thanks!

 

P.S I have included a screenshot of the problem and the customized css.

Screen-Shot-1.PNG

Link to comment
10 hours ago, ginna said:

Yes!

 

I believe this is what you meant. If not please let me know.

 

Thank you for your help!

 

 

screen shot 2.PNG

Can you share your website URL?

If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks

MD Rofik
Website Designer and Digital Marketer

Am I helpful? Want to offer me a coffee?
Send me a message if needed any help. I'll try to reply as soon as possible.


 

Link to comment
3 minutes ago, ginna said:

 

Replace this code(See attached image) with the code below.

.list-item-content {
    margin-top: -134%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4) 25%,rgba(0, 0, 0, 0.4) 75%);
    padding: 1rem;
    transition: all 0s;
    z-index: 99;
    opacity: 0;
}
.list-item:hover .list-item-content {
    transition: all 0s;
    opacity: 1;
}

 

Screenshot_291.png

If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks

MD Rofik
Website Designer and Digital Marketer

Am I helpful? Want to offer me a coffee?
Send me a message if needed any help. I'll try to reply as soon as possible.


 

Link to comment
2 minutes ago, ginna said:

This seems to be working! 

Can I ask if there is a way to change the text to white?

 

Thank you!

Sorry I didn't understand. The text already white.

If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks

MD Rofik
Website Designer and Digital Marketer

Am I helpful? Want to offer me a coffee?
Send me a message if needed any help. I'll try to reply as soon as possible.


 

Link to comment
5 minutes ago, ginna said:

The text changed to black when I pasted the code in. I tried to add in the part of the code that was making the text white but it isn't working.

Can you add the code again and save it? It will be easier to check.

If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks

MD Rofik
Website Designer and Digital Marketer

Am I helpful? Want to offer me a coffee?
Send me a message if needed any help. I'll try to reply as soon as possible.


 

Link to comment
6 minutes ago, ginna said:

The text changed to black when I pasted the code in. I tried to add in the part of the code that was making the text white but it isn't working.

I got it. You have removed this code. That's why text is black. Please add this code again. 

.list-item-content * {
    color: #fff !important
}

 

If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks

MD Rofik
Website Designer and Digital Marketer

Am I helpful? Want to offer me a coffee?
Send me a message if needed any help. I'll try to reply as soon as possible.


 

Link to comment
  • Solution
3 minutes ago, ginna said:

I did try this and save it, perhaps I have it wrong?

 

screen shot 3.PNG

You have putted the code in the middle of code. You should need to put it bottom. See the image

Screenshot_294.png

Edited by Web_Solutions

If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks

MD Rofik
Website Designer and Digital Marketer

Am I helpful? Want to offer me a coffee?
Send me a message if needed any help. I'll try to reply as soon as possible.


 

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.