I have a website with a fullscreen background image.
html, body {
height: 100vh;
}
html {
background: url('/img/background.jpg') no-repeat center center fixed;
background-size: cover;
}
This code works fine on most devices, but on some old Android devices, this causes a problem when scrolling down. Partially scrolling down, but not releasing your finger shows a white bar equal in size to the URL bar that is disappearing at the same time. Once you release your finger the background fixes itself.
This is what the image looks like mid-scroll.
Is there a way to make sure the background is always filling the page?
Edit: I have also tried adding a div with these properties:
#background {
background: url('/img/background.jpg') no-repeat center center fixed;
background-size: cover;
z-index: -100;
position: absolute;
top: 0;
left: 0;
right: 0;
height: 200vh;
}
This shows the background but the same problem occurs.