Design comparison
Solution retrospective
This was my first challenge using an API, suggestions and ways to improve are welcome
Community feedback
- @0xabdulkhaliqPosted over 1 year ago
Hello there ๐. Congratulations on successfully completing the challenge! ๐
- I have other recommendations regarding your code that I believe will be of great interest to you.
CSS ๐จ:
- Looks like the component has not been centered properly. So let me explain, How you can easily center the component without using
margin
orpadding
.
- We don't need to use
margin
andpadding
to center the component both horizontally & vertically. Because usingmargin
orpadding
will not dynamical centers our component at all states
- You already using
Flexbox
for layout, but you didn't utilized it's full potential. Just add the following rules to properly center the component.
body { min-height: 100vh; }
- Now remove these styles, after removing you can able to see the changes
main { margin-left: auto; margin-right: auto; margin-top: 15vh; }
- Now your component has been properly centered
.
I hope you find this helpful ๐ Above all, the solution you submitted is great !
Happy coding!
1 - @NehalSahu8055Posted over 1 year ago
Hello Coder ๐.
Congratulations on successfully completing the challenge! ๐
Few suggestions regarding design.
-
Remove
margins
from the<main>
as this will not dynamically center the card. -
To properly center the container.
-
As you are already using flex just add
min-height:100vh
to yourbody
and see the effect.
body{ min-height: 100vh; display: flex; align-items: center; justify-content: center; }
I hope you find this helpful.
Happy coding๐
1 -
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