Submitted over 1 year ago
Responsive stats preview card, using flexbox and mobile first
@PastoreMartina
Design comparison
SolutionDesign
Solution retrospective
How else could I have done the violet overlay for the image? I don't think I achieved the correct result, but I couldn't make anything else work.
Community feedback
- @MelvinAguilarPosted over 1 year ago
Hello there π. Good job on completing the challenge !
I have some suggestions about your code that might interest you.
- You can use the
<picture>
tag when you have different versions of the same image πΌ. Using the<picture>
tag will help you to load the correct image for the user's device. You can read more about this here π.
-
To recreate the exact purple color of the image you can do the following:
.image-container { background-color: var(--violet); . . . } img { mix-blend-mode: multiply; opacity: 0.75; }
Explanation:
- The first style sets the background color of the container element to a specific shade of purple.
- The second style applies a blending effect to the image by setting the
mix-blend-mode
property to multiply. This means that the image will blend with the background color in a way that multiplies the color values of each pixel.
- Finally, the opacity property is set to
0.75
, which means that the image is slightly transparent, allowing some of the background color to show through.
I hope you find it useful! π Above all, the solution you submitted is great!
Happy coding!
Marked as helpful1@PastoreMartinaPosted over 1 year ago@MelvinAguilar Thank you!! I didn't know any of the things you explained, this is very helpful :)
0 - You can use the
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