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
Desktop layout |
---|
Desktop layout hover |
---|
Mobile layout |
---|
- Solution URL: https://github.com/PavlinaPs/NFT-preview-card-component
- Live Site URL: https://pavlinaps.github.io/NFT-preview-card-component/
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- Mobile-first workflow
Fist I tried to solve the image hover state by using z-index, but it didn't work out due to unexpected behaviour, at least for me as of now - some weird flashing occured.
Then I learned the hard way that there is a big difference in setting opacity:
.div {
opacity: 0.5;
}
and
.div {
background-color: hsl(178, 100%, 50%, 0.45);
}
I find this challenge very useful for me.
I need to practice a lot to get faster.
When deciding how to make the horizontal line - with <hr> element or a <div> I checked out these two pages:
- <hr>: The Thematic Break (Horizontal Rule) element on MDN
- How to make a horizontal line without using <hr> tag? - a nice summary on Stack Overflow (<hr>, <div>, pseudo class)
- GitHub - PavlinaPs
- Frontend Mentor - @PavlinaPs
It is great that I can solve Frontend Mentor's challenges. They are all very useful for me. Thank you!