One issue I'm facing is that the ::before
selector doesn't extend vertically in a fixed element.
Does anyone know of a way to ensure the background fills the entire height? Currently, when a user scrolls, the ::before
elemeent stops once the user has scrolled outside the viewport.
I am seeking a solution that doesn't involve javascript.
Thank you for any help provided.
Note: I am using SASS, so answers can be in SCSS or plain CSS.
View full code here: https://jsfiddle.net/u7fvb2nq/
Snippet:
.outer
position: fixed
&::before
content: ''
position: absolute
left: 0
top: 0
bottom: 0
right: 0
background-image: linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.3))