On my webpage, there are animations that intentionally change the height of the page. Initially, when the page loads and the height is set to 100%, the background image covers the entire page. However, as the animations run, the page height can exceed 100%. To ensure that the background still covers the page effectively even during animations, I have to adjust the background height to a larger value (e.g. 200%). But by doing so, the overall page height also changes. Is there a way to dynamically cover the page during animations while maintaining the page height at 100% when animations are not running?
Below is the CSS code for the background:
background: url(background2.jpg)repeat 5% 5%;
position: absolute;
background-size:cover;
top: 0; left: 0; right: 0; bottom: 0;
z-index: 400;
height: auto;
width: auto;