Design comparison
Solution retrospective
Hi everyone, thank you for checking out my solution! It's my first in over year without any practice as I'm trying to get back into it and hopefully this time I do not stop. I had a few layout issues so your comments would be much appreciated. Also I tried to use the JSON file and JS to dynamically add the scores into the card. The way I coded it I believe was not very efficient any tips on the JS would be very much appreciated
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
- To properly center the component in the page, you should use
Flexbox
orGrid
layout. You can read more about centering in CSS here π.
- For this demonstration we use css
Grid
to center the component.
body { min-height: 100vh; display: grid; place-items: center; }
- Now remove these styles, after removing you can able to see the changes
@media only screen and (min-width: 1024px) body { padding: 25rem 20rem; }
- Now your component has been properly centered
- And along with that you want to wrap the both
div
elements withdiv
element and apply these styles
main { display: grid; grid-template-columns: 1fr 1fr; }
.
I hope you find this helpful π Above all, the solution you submitted is great !
Happy coding!
1@mroungouPosted over 1 year agoThank you very much for the feed @0xAbdulKhalid! I will be looking at your suggestions and make the appropriate changes!
0@0xabdulkhaliqPosted over 1 year ago@mroungou Glad you found it helpful ! π€
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