@TH3RIV
Posted
Hi, @nerdy-guy!
You can very easily center your container using flexbox or grid on the parent container:
body {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
or
body {
min-height: 100vh;
display: grid;
place-content: center;
}
This way you do not need to use margins to center you containers, it centers it in the parent container.
Also try to avoid using px
values as much as possible and use rem
instead.
Hope this helps!
Marked as helpful
@nerdy-guy
Posted
@TH3RIV Thanks for your feedback, it was very helpful.