Currently, I am customizing a template from HTML5UP (Astral: ). However, I have encountered an issue. My goal is to change the background image with each ID, but every attempt using JavaScript or CSS only modifies the specific section's background instead of the entire page's background. The demo project can be viewed here:
An example of the problem can be seen on this page:
The desired appearance for the section's background should be like this:
To clarify, I want to keep the white background for each section while changing the actual background.
The approach I used that results in the error was:
<script>
// Changing background image with pure JavaScript
document.getElementById('about').style.backgroundImage =
'url("assets/css/images/overlay.png"),
url("assets/css/images/bg2.png"),
url("assets/css/images//bg.jpg")';
</script>
In context, the Astral theme is a single long-scrolling page converted to display sections as individual pages. This modification might be causing the section-background problem, which I am struggling to resolve.
I have searched through multiple pages and forums without finding a viable solution. While there are plenty of options for changing backgrounds on usual websites using JS or CSS, none seem to work in my current situation. Thank you in advance for any assistance!