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.
Note: Delete this note and update the table of contents based on what sections you keep.
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- Mobile-first workflow
I learned that I can use pseudo-elements for images overlays
&__img {
background-image: url('../../images/image-header-mobile.jpg');
background-size: cover;
border-top-left-radius: 0.5rem;
border-top-right-radius: 0.5rem;
height: 17.5rem;
position: relative;
margin-bottom: 2.5rem;
width: 100%;
&::before {
content: '';
position: absolute;
inset: 0;
background-color: $--accent-transparent;
border-top-left-radius: 0.5rem;
border-top-right-radius: 0.5rem;
filter: brightness(0.3) contrast(1) saturate(5);
}
}
- LinkedIn - Rafael Takano
- Frontend Mentor - @rafaeltakano