Stats Preview Card Component using both grid and Flex Box
Design comparison
Solution retrospective
Hey Everyone, I have completed the challenge using the grid and flexbox.
Check out my following article, where I have briefly explained the steps I have followed to complete this challenge.
https://uxplanet.org/challenge-008-stats-preview-card-component-aaec8046a984
Thank you for checking this out, and feel free to leave your feedback and thoughts!! Any feedback and tips are welcome.
Many Thanks! Nathasha π
Community feedback
- @correlucasPosted about 2 years ago
πΎHello Natasha, congratulations for your new solution!
Your solution is already really good, you can improve it fixing the alignment vertically like David said and also reducing your code for the overlay effect with 2 lines. To add the exact same purple overlay effect for the image, matching the design files you can use,
filter
ormix-blend-mode
. See the code belowimg { mix-blend-mode: multiply; opacity: 75%;}
Instead of importing the card image with CSS you can manage it inserting the tag
<picture>
to wrap both desktop and mobile images together in the same tag, and render each image depending of the device (phone / computer) by the settings for the width you'll insert in the htmlπ I hope this helps you and happy coding!
0 - @DavidMorgadePosted about 2 years ago
Hello Nathasha, congrats on finishing the challenge, pretty good job in my opinion!
Just a little suggestion if you don't mind.
If you want to center your card in the middle of the screen, try using flexbox for a perfect center instead of margin, you just have to set up the minimum height of the body to 100vh (wich will make the body take the full screen), and then use flexbox to center the child content, you can try by getting rid of the margins on your
div class='main-container'
and adding this to your body:body { display: flex; justify-content: center; align-items: center; min-height: 100vh; }
With this your component will be completely centered on the screen!
Hope my feedback helps you!
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