I should do a mobile-first site - Stats Preview Card Component
Design comparison
Solution retrospective
I struggled with the mobile version on this one. As always my CSS is messy, but I don't think it's as messy as before. Overall I'm happy about this. If you have any suggestions please write a comment.
Community feedback
- @correlucasPosted about 2 years ago
👾Hello @weakiam, congratulations on your solution!
Nice code and nice solution! You did a good job here putting everything together. I’ve some suggestions for you:
To get closer to
overlay effect
on the photo as the Figma Design its better you usemix-blend-mode
. All you need is thediv
under theimage
with thisbackground-color: hsl(277, 64%, 61%);
and applymix-blend-mode: multiply
andopacity: 80%
on theimg
orpicture
selector to activate the overlay blending the image with the color of the div. See the code bellow:img { mix-blend-mode: multiply; opacity: 80%; }
Here's a good article explaining these effects with mix-blend-mode:
https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode
✌️ I hope this helps you and happy coding!
Marked as helpful0 - @DeolabestPosted about 2 years ago
Hey @, Congratulations on completing this challenge!
Here is my feedback:
- To avoid the design going below the page, add this min-height: 100vh; to the body.
i.e. body { min-height: 100vh; background-color: hsl(233, 47%, 7%); display: block; color: white; font-family: 'Inter', sans-serif; }
Keep doing a good job!
Marked as helpful0 - @CodeWithAlaminPosted about 2 years ago
I would like to suggest you few thing on this solutions if you don't mind.
-
It's not a good practice to use a fixed unit value such as "px". You can use the "rem" and "em" unites instead. When users zoom in into page, fixed values like px doesn't increase, and it gives weird results sometimes. So, convert all the px values to rem.
-
When you use media queries, try to use "em" unit instead of px on your breakpoints. It is very important for making your page more responsive to all kinds of devices.
-
You could use the (mix-blend-mode: multiply) instead of an overlay with opacity which made the image grayish.
Overall, you did a great job finishing this challenge.
Thanks!
Marked as helpful0 -
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