0
Can you use margin instead of top, left, right (position absolute)?
Margin:50% 50% 50% 50%; Instead of Position:absolute; top:50%; Left:50%;
4 Answers
+ 2
You looks succeed, but if there is content, your box shifted down.
I added position: absolute;
It's still relative, I further added top:0; and it goes up to margin-top:450px (count from body)
My modified on yours:
https://code.sololearn.com/WuOn8XlE7C5v/?ref=app
+ 3
Interesting idea
Did you try it in code playground?
What result did you get?
0
Gordon This is a result with the margin https://code.sololearn.com/W6OgnJLuRm48/?ref=app
0
Gordon Thanks!!!!