Yes, I already looked at all the suggested answers. No, none of them work
So I've created an animated background of stars that I want to make repeat for as far down as you scroll on my website. However, when you scroll past the initial viewport, the background cuts off.
The following is my (relevant) SCSS code. Does anyone know what I would need to change?
.stars-container {
background: black repeat;
background-attachment: fixed;
position: absolute;
top: 0px;
left: 0px;
z-index: -10;
width: 100%;
height: 100%;
overflow:hidden;
@mixin stars-child($time, $opacity) {
display: inline-block;
width: 100%;
height: 100%;
position: absolute;
top: 0px;
left: 0px;
animation: slide $time linear infinite;
opacity: $opacity;
background-repeat: repeat;
}
.stars1 {
@include stars-child(10s, 100%);
background: url(/images/stars/1.png) repeat center;
}
.stars2 {
@include stars-child(20s, 95%);
background: url(/images/stars/2.png) repeat center;
}
.stars3 {
@include stars-child(30s, 90%);
background: url(/images/stars/3.png) repeat center;
}
.stars4 {
@include stars-child(40s, 85%);
background: url(/images/stars/4.png) repeat center;
}
.stars5 {
@include stars-child(50s, 80%);
background: url(/images/stars/5.png) repeat center;
}
.stars6 {
@include stars-child(60s, 75%);
background: url(/images/stars/6.png) repeat center;
}
@keyframes slide {
from {background-position: 0px;}
to {background-position: 900px;}
}
}
And this is the very minimal bit of HTML that I used to implement this background
<div class="stars-container">
<div class="stars1"></div>
<div class="stars2"></div>
<div class="stars3"></div>
<div class="stars4"></div>
<div class="stars5"></div>
<div class="stars6"></div>
</div>