I have looked everywhere so much so that it looks like it’s not possible yet.
I am looking for something like an opacity gradient mask if that makes sense.
Like this:
It may just look like a straight forward text fade from white to transparent but it’s more so that it’s the div that the text is within which is fading to background.
The text is overflowing outside the div area so it’s indicating to a user to scroll up.
So it’s like a layer mask with a gradient in photoshop, maybe something like {opacity: linear-gradient(#fff, #000)}
, does something like this exist?
Is this a possibility with CSS at all?
4
Answers
You can use this:
from here:
To customize IE looks, you can stylize it from here:
you can customize the color you wish and number of procentage for linear gradient style.
Yes its possible. You can use tools like CSS Gradient Generator to get the gradient colors you want (even transparencies) Then you can make a
div
that is over your text. In your case you would want to select a vertical fade and then allow the top to be transparent and the bottom would have a color. Then you can position thatdiv
with your gradient background over your text. Here is the code I used:CSS
HTML
you will need to play with the code in order to get it to work for your specific environment but that should get you started. You can see it in action here. Hope that helps.
You can use a pseudo element for this (which would reduce markup as well as speed up rendering):
(note. this is only a draft for illustration only. Please use your own coloring).
You can get this effect with masking. mask-image = gradient makes it
This will work only on webkit browsers. You can get Firefox support by doing it on a svg element