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.
Users should be able to:
- View the optimal layout depending on their device's screen size
- See hover states for interactive elements
- Solution URL: solution URL here
- Live Site URL: live site URL here
Desktop-first workflow
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- Desktop-first workflow
Just glancing through this code, after I've finished writing the code, it felt so easy. but honestly, the hardest part for me was the aspect where on hover, we were to render another image on top of the previous image and with background colour as well with the opacity of the background lighter than the image itself being rendered alongside. I've never done any project as such. So having coded this today I learnt how to do just that. Some of the code snippets were the codes are:
.imgCont {
width: 100%;
display: flex;
justify-content: center;
}
.imgCont img {
width: 100%;
border-radius: 10px;
margin-bottom: 20px;
transition: all 1s ease-in-out;
}
div.viewImageContainer {
position: relative;
}
div.viewcontainer {
position: absolute;
top: 0px;
left: 0px;
}
div.viewcontainer img {
opacity: 0;
padding: 110px;
color: white;
}
div.viewcontainer img:hover {
opacity: 1;
cursor: pointer;
background-color: rgba(0, 255, 247, 0.3);
transition: all 0.5s ease-in-out;
}

