Currently working on a "our story" section where the divs move up and change the background image when they reach the center of the screen. I am aiming for a fixed background image that transitions smoothly when the div is in the middle. The relationship between the background image and the div is crucial.
Still honing my styling skills as I strive to achieve the desired effect.
For reference, you can view what I'm trying to accomplish at the following link:
Reference:
.parent {
background-image: url(https://picsum.photos/1080/1920);
background-size: cover;
background-repeat: no-repeat;
background-position: center;
background-attachment: fixed;
height: 300vh;
text-align: center;
color: white;
}
.div1{
background-color: aqua;
height: 50vh;
margin-top: 90vh;
padding: 20px;
width: 400px;
margin: 90px auto
}
.div2{
background-color: skyblue;
height: 50vh;
padding: 20px;
width: 400px;
margin: 90px auto
}
.div3{
background-color: grey;
height: 50vh;
margin-top: 90vh;
padding: 20px;
width: 400px;
margin: 90px auto
}
<div class="parent">
<div class="div1" >
Content about desert
</div>
<div class="div2" >
Content about mountains
</div>
<div class="div3" >
Content about birds
</div>
</div>