This is a solution to the NFT preview card component challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- Mobile-first workflow
I learned how to properly do an image overlay, I still think it looks a little bit 'hacky' but it's backed by W3Schools.
.overlay {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: 100%;
width: 100%;
opacity: 0;
transition: 0.3s ease;
background-color: red;
}
.container:hover .overlay {
opacity: 1;
}
.icon {
color: white;
font-size: 100px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
text-align: center;
}
- LinkedIn - Rafael Takano
- Frontend Mentor - @rafaeltakano