I am facing an issue with layering background-images on my webpage. I have a background-image named 1
at the bottom of the page, and I want to display another div with a background-image named 2
over the bottom 5% of background-image 1
(not the bottom 30% of the screen but bottom 30% of the image).
The main challenge is making this setup responsive. It seems like I need to calculate some sort of ratio, but I am unsure how to proceed. Below is the code that I currently have. Whenever I resize the screen, the size of background-image 1
changes, causing the position of background-image 2
to shift as well. How can I ensure that it remains fixed in one place regardless of screen size?
Check out the JSFiddle link for the code example: here