I completed this lab successfully recently but I had an issue where I could couldn’t center my main house element in the viewport when I changed the viewport size. I found a solution in an internet article that used the following code, margin-top and bottom and transform property, but I don’t understand it.
How does it achieve centering when you use the -50% values in the translate function? Can anyone clarify this?
I just checked my notes, yes I’m aware of relative versus absolute units.
I’m a bit hazy on what I tried. I think I was using vw/vh which didn’t work, can’t remember if I exhaustively tried other units before finding the translate value which did the trick.