Design comparison
Solution retrospective
hello everyone, this is my first web page. happy to share with u all
open for your advice and suggestions
Community feedback
- @nmnjnklcPosted about 2 years ago
Hello @yathishg,
there is no need for margins to center a div or some other element. Just add these properties to its parent element and you are good. For your particular situation:
body { height: 100vh; display: flex; align-items: center; justify-content: center; }
This will also fix width problem on that card. Note that without that height: 100vh property, card would be horizontally centered, but not vertically. Centering card like does not require additional margins, widths, heights etc. to element.
Hope this helps. Happy coding!
Marked as helpful0 - @cvalencia1991Posted about 2 years ago
you should fix the with of the card, also the font size should be more similar to the project and the final thing of the card you have to delete 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