If you visit this link, you can see the page in progress:
This piece of code is what I'm using to center the div element:
div {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 70%;
height: auto;
padding: 20px;
background-color:rgba(255, 255, 255, 0.2);
color: white;
text-align: center;
border-radius:5px;
border:2px solid rgba(255, 255, 255, 0.5);
}
However, when I resize my browser window or view it on a mobile device, part of the content at the top of the page gets cut off.
I want the div to always be centered no matter the width of the browser. But if the height becomes too small, I would rather have some margin space added to the top and bottom while ensuring all text remains visible.
What am I missing in my implementation that's causing this issue?