I recently implemented a modal popup form on my website that covers the entire viewport with its background. However, I am facing an issue where the footer of the website is still displayed on top of the modal background, even though everything else seems to be working correctly. The modal is triggered by a simple JavaScript function.
Below is the CSS code I am using:
#footer {
position: fixed;
width: 100%;
z-index: 2;
bottom: 0;
padding: 8px;
background-color: #688596;
color: white;
box-shadow: 0px 2px 8px #676767;
}
.modalBackground {
display: none;
position: fixed;
z-index: 1;
padding-top: 100px;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgba(180, 180, 180, 0.6);
}
The JavaScript code toggles the display property of .modalBackground from 'none' to 'block' to show the modal. While everything seems to be working fine, the issue with the footer remaining on top persists. Any insights or suggestions on what I might be missing here would be greatly appreciated. Thank you in advance!