I am struggling to find a solution to what seems like a common question but unfortunately haven't been able to locate an answer on Google. Any assistance would be greatly appreciated.
My website features a full-size resizable background image using the following CSS:
html
{
background-size:contain;
background: black url(../images/myimage.jpg);
background-repeat:no-repeat;
background-attachment:fixed;
background-position:center;
}
Within this image, I have two z-layer DIVs - one with an image and another with text.
However, when resizing the browser window, my DIVs become unpredictable and do not adjust accordingly. They remain static while the background image shrinks.
How can I ensure that these DIVs containing important elements are always in the correct position regardless of screen resolution or resizing? Would CSS, JavaScript, or jQuery be the best approach?
Any advice on the most effective method to achieve this would be highly appreciated!
p.s. Please let me know if clarification or a sample code snippet is required.