@Hassiai
Posted
To center .wrapper on the page, add min-height:100vh; display: flex; align-items: center: justify-content: center; or min-height:100vh; display: grid place-items: center to the body.
To center .wrapper on the page using flexbox:
body{
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
To center .wrapper on the page using grid:
body{
min-height: 100vh;
display: grid;
place-items: center;
}
Hope am helpful.
Well done for completing this challenge. HAPPY CODING
@KrzysztofRozbicki
Posted
@Hassiai Hello - thank you for reply and advice. I know the flex and grid method. I would love to know if it is better than the method i Used- which is simply absolute positioning with -50% translate.
@Hassiai
Posted
@KrzysztofRozbicki it is a responsive method, its centers your content on the screen irrespective of the screen size.
Marked as helpful
@KrzysztofRozbicki
Posted
@Hassiai ok, will check that. I have noticed that my method is also responsive 100% because the position is % of screen but also have seen that it is kind of messed up when i am putting the mobile device horizontally. Will check the flex method for sure in the next challenge. Thanks.