This is a solution to the Stats preview card component challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- View the optimal layout depending on their device's screen size
- Solution URL: on Frontend Mentor
- Live Site URL: on Github
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- Mobile-first workflow
Using background-blend-mode
property to let the element's background image blend with the element's background color.
<main>
<div class="text-info">
</div>
</main>
main::before{
background-blend-mode: multiply;
background-color: var(--accent-color);
background-image: var(--mobile-decorative-image);
background-position: center top;
background-repeat: no-repeat;
background-size: cover;
}
Technique that I'm not completely familiar with, can be found in this challenge:
background-blend-mode
property.
Technique that I found useful, although not using in this challenge:
- SASS
- background-blend-mode on MDN - This helped me to blend the element's background image with the element's background color.