Hi, is there any way to put the page at the center of the body without manually using margins? Justify-content and align-items seems to work but it doesn't affect the top of the page. Thanks. feedback are appreciated.
Stefan Cristian
@xSStephenAll comments
- @OsauyiSubmitted about 2 years ago@xSStephenPosted about 2 years ago
Hello Osauyi! Great solution for this challange!
Regarding your question, you can use the following code to center the parent container in the middle of the screen using flexbox.
display: flex; justify-content: center; align-items: center; min-height: 100vh;
Marked as helpful1 - @faha1999Submitted about 2 years ago@xSStephenPosted about 2 years ago
Very nice solution, Fahad! Keep up the good work! :D
0 - @npetrovic12Submitted about 2 years ago@xSStephenPosted about 2 years ago
Hello Nikola! Great solution for this challange!
I only have a few ideas for this on how it can be made better: 1.Use <main> instead of <div> to wrap the card container. This way you show that this is the main block of content and also replace the div with a semantic tag.
2.Use units as rem or em instead of px to improve your performance by resizing fonts between different screens and devices. These units are better to make your website more accessible. REM does not just apply to font size, but to all sizes as well.
Keep up the good work! :D
0