My goal is to have text fade in and out of the page as you scroll, and I am using a gradient background clip to accomplish it. This works fine in Chrome, and it even works in Safari in codepen, but it isn't working on my live site.
Here's the code:
html, body{ background: pink; }
p{ margin: 0px; }
.clip{
background: linear-gradient(transparent, black, transparent);
background-attachment: fixed;
-webkit-text-fill-color: transparent;
-webkit-background-clip: text;
font-family: sans-serif;
font-size: 65px;
font-weight: bold;
text-align: center;
margin-bottom: 20vh;
}
Here's the codepen: https://codepen.io/wylliam-judd/pen/rNadBaX
And here's the live site: http://www.vrlu.com
One difference between the two is that the background clip is in a container on the live site. Here's the code there:
.summary-text {
background: linear-gradient(transparent, black, transparent);
background-attachment: fixed;
-webkit-text-fill-color: transparent;
-webkit-background-clip: text;
}
.medium-text {
font-size: 22px;
font-weight: bold;
text-transform: uppercase;
margin-top: 30px;
width: 50%;
}
But if I move the css from .summary-text
to .medium-text
and try on localhost, it still doesn't work.