So Currently, I am creating a modal that is centered in the middle of the page by position absolute. The problem is when I adjust my broswer height and only the height, it will push the modal up and touch the top of the screen and even go pass it. I just want to know how to stop that from helping.
.modal-container {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.7);
z-index: 9;
}
.callLogForm__container {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
max-width: 55rem;
max-height: 65rem;
margin: auto;
background-color: white;
border-radius: 11px;
display: flex;
flex-direction: column;
align-items: center;
}
Parent of modal-container
<>
{navRoutes.includes(location.pathname) ? <NavBar /> : null}
<main
className={
sideMenuRoutes.includes(location.pathname)
? "main-container flex-box"
: "main-container"
}
>
{sideMenuRoutes.includes(location.pathname) ? <Sidemenu /> : null}
<Routes />
</main>
<Modal />
</>
This is what is doing when I shrink the browswer's height and only the height.
