I have been analyzing this code which is an alternative to using background-attachment: fixed, but have some questions that I can’t seem to figure out. I have tried to find the answers online without success. Can someone please help? The code is:
body::before {
content:”;
position: fixed;
top: 0;
left: 0;
height: 100%;
width: 100%;
z-index: -1;
background: var(—color-darkblue);
background-image: linear-gradient(rgba(58, 58, 158,0.8), rgba((136, 136, 206, 0.7)),url(#);background-size: cover;
background-repeat: no-repeat;background-position: center;
}
Question 1: Does position fixed, fix the background color (dark blue) and the url image so it doesn’t move when you scroll?
Question 2: which property or properties modify the background color and / or the background-image? For example does top:0 and left: 0 modify the background color only? Does background -size modify the url(jpeg) only?
Question 3: don’t you need to add (will-change: transform;) in the code.
Thank you so much. I have been trying for the past 3 days to figure this out.