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: https://www.frontendmentor.io/solutions/nft-preview-card-using-html-css-and-flexbox-GeBShcdRZ
- Live Site URL: https://nakoyawilson.github.io/nft-preview-card-component/
- HTML
- CSS
- Flexbox
I learned to use the adjacent sibling selector to make the view icon appear on hover.
.view {
display: none;
}
.image-container:hover .overlay + .view {
display: block;
}
For future projects I need to focus on using more advanced CSS to create effects.
- How To Create an Overlay Image Icon - This helped me to add an overlay to the image on hover.
- Using only CSS, show div on hover over another element - This Stack Overflow question helped me to figure out how to show the view icon on hover.
- Twitter - @khaledb93550140
- LinkedIn - @khaled benahmed