@SvitlanaSuslenkova
Posted
body { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 100vh; } Try this to align(top-bottom) and justify(left-right) your project to the center. It applies to the parent component(body), don't forget about !!min-height!!. You can use grid instead of flex too.
To center you can use 1. flex 2. grid 3.parent element-padding+child element width:100%. Depends on situation.
Marked as helpful
@SvitlanaSuslenkova I knew there would be a way to do it using flexbox. Just tried it and so much easier and required a lot less effort. Cool know i can use flex, grid or that third suggestion you gave. I will have to try that one as well! Quick question. Im still brand new and haven't learned vh yet. What is the purpose/use of that element. Thank you again so much for your input as well!