Hello, I am having problem when centering div horizontal and vertical.
This is how it looks when I do not resize (first screenshot) https://prnt.sc/TssG9JP6zMzt
And this is when I resize (second screenshot) https://prnt.sc/WAEaStDKi2i6
I am using this technique for center vertical and horizontal:
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
Div box (with black border) is overlap with h1. And space between h1 and div is too big even when I turn of all margins and padding. Any thoughts?
P.S. I know I can solve with flex but I wanted to know and learn using this technique.