I'm currently working on a project that involves creating a pop-up window.
CSS Styling
<style type="text/css">
#modalPage
{
display: none;
position: absolute;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
background-color: rgba(0, 0, 0, 0.95);
z-index: 999;
}
.modalContainer
{
position: absolute;
width: 100%;
height: 100%;
left: 50%;
top: 50%;
z-index: 999;
}
</style>
Content CSS
.modal
{
background-color: #6f9255;
position: relative;
top: -300px;
left: -305px;
z-index: 1000;
width: 600px;
overflow:auto;
}
JAVASCRIPT Code
<script type="text/javascript">
function showPopup() {
document.getElementById('modalPage').style.display = "block";
}
function hidePopup()
{
document.getElementById('modalPage').style.display = "none";
}
</script>
HTML Markup
<div id="modalPage">
<div class="modalContainer">
<div class="modal"> </div>
</div>
</div>
However, I've encountered an issue where the page background color set with this code
background-color: rgba(0, 0, 0, 0.95);
only covers half of the page instead of the full page.
Due to the length of the pop-up content exceeding the original page size and overlapping with the footer links when using fixed positioning, I cannot keep the position fixed.
Any insights or suggestions would be greatly appreciated.
Thank you!