@danielmrz-dev
Posted
Hello, @Xarlizard!
Your project is looking fantastic!
I'd like to suggest a way to make it even better:
- Using
margin
isn't always the most effective method for centering an element.
Here's a highly efficient approach to position an element at the center of the page both vertically and horizontally:
š Apply this CSS to the body (avoid using position
or margins
in order to work correctly):
body {
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
I hope you find this helpful!
Keep up the excellent work!
Marked as helpful
@Xarlizard
Posted
@danielmrz-dev eyo Daniel, yes definitely!
You also pointed that out on a previous exercise of mine and I hadn't seen it until after uploading this one so, yeah, I already know it thanks to you š
On my new exercises, I've already implemented your suggestion with display: flex;
on the body;
Again, thx for pointing it out!
Have a good one m8 š
@danielmrz-dev
Posted
@Xarlizard
Did I? š
I'm sorry, I'm very active on the platform and I make a lot of comments, so I don't always remember if I already commented on one of your solutions š
Anyway, I'm glad I could help!
@Xarlizard
Posted
@danielmrz-dev yes xD, both responses were 1 hour apart from each other...š
Anyways I'm glad to have you on this community, your tips are so well formatted/written you actually sound like a real teacher lol š
@danielmrz-dev
Posted
@Xarlizard
Thank you for your kind words š
I'm really glad my comments were useful ā