In my Next.js project, I am encountering an issue with the background image not displaying on longer pages when viewed on a Google Pixel 3a device. Here is how it looks on shorter pages that do not exceed the viewport height: https://i.sstatic.net/jJBTy.png
However, on longer pages that require scrolling to reach the bottom, the background image does not display at all: https://i.sstatic.net/e30co.png
body {
background-image: url("https://via.placeholder.com/500");
background-size: cover;
margin: 0;
padding-left: 5vw;
padding-right: 5vw;
height: 100vh;
min-height: 100%;
width: 90vw;
font-family: system-ui;
overflow-x: hidden;
font-size: 1.3rem;
}
Changing the background-size property to 'auto' allows the image to be displayed on every page, but I prefer it to be set to 'cover'. I may not fully understand how 'cover' works for pages that require scrolling, but I want the background image to remain fixed as shown in the first image. When the content extends beyond the viewport, I want the content to scroll while keeping the background image static. Any assistance on this matter would be greatly appreciated. Thank you.