Design comparison
Solution retrospective
I struggled using Flexbox and also properly aligning my items.
Community feedback
- @danielmrz-devPosted 8 months ago
Hello, @PromiseLanga!
Your project is looking fantastic!
I'd like to suggest a way to make it even better:
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
ormargins
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 helpful0 - @Lo-DeckPosted 8 months ago
hi, first thing .
body { background-color: var(--color1); width: 1440px; }
Don't set
width: 1440px;
it's useless, if your screen is bigger than 1440px you will have a bad behavior.And try to center the item within the body with
flex
orgrid
.Check out your html with the 3wc validator, it will show you all your mistakes.3wc.
Correct your html first, it's the way to have a better website.
Hope to be helpful.
Marked as helpful0@PromiseLangaPosted 7 months ago@Lo-Deck Thank you so much, it is helpful. I will fix it.
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord