Responsive Stats Preview Card using pure CSS

Please log in to post a comment
Log in with GitHubCommunity feedback
- @correlucas
👾Hello Shiva, congratulations for your new solution!
Here's some tips to improve your photo:
To have your image purple with the same overlay effect, you need to use
mix-blend-mode
to make this color blend between the image and the background-color of the container. See the steps below to apply to theimg
orpicture
selector. And the best part is that you;ll have a code really more clean than the current code, see the difference":BEFORE:
.card__img::before { content: ""; inset: 0; position: absolute; background-color: var(--clr-primary-accent-light); opacity: 50%; }
AFTER
img { mix-blend-mode: multiply; opacity: 75%;}
Try to fix the image responsiveness
display: block
andmax-width: 100%
andobject-fit: cover
to make the image auto-crop when resizing inside the column:img { display: block; object-fit: cover; max-width: 100%; }
👋 I hope this helps you and happy coding!
Join 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