This is my 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
- Live Site URL: https://braien-machado-nft-preview-card.vercel.app/
- HTML
- CSS
I learned about adjacent-sibling selectors to change css properties of elements while hovering on another. Before learning it, i would use javascript to set this dependency.
.view-icon:hover + .card-img {
opacity: 0.6;
}
The css above changes opacity of the element with the "card-img" class that is following the one with "view-icon" class when hovering on it. If you want an article about this selector, check here.