Responsive nft preview card built with HTML/CSS
Design comparison
Solution retrospective
Only pain point I had on this challenge was getting the hover state for the image to work how I wanted it to. Had to use a workaround where I included an 'overlay' class that is set to 0 opacity until hovered. I also set the background color using rgba in order to have just the background color have opacity, and not affect the view icon.
Community feedback
- @Finney06Posted over 1 year ago
Hello there π. Good job on completing the challenge !
Here are some suggestions regarding your code that may be of interest to you.
HTML π€:
To clear the Accessibility report:
-
Wrap the page's whole main content in the
<main>
tag. -
Use HTML5 semantic elements such as
<header>
,<nav>
,<main>
,<aside>
, and<footer>
to define these sections. -
Usa an
<h1>
tag for the main text in the design given and always avoid skipping heading levels; Starting with<h1>
and working your way down the heading levels (<h2>
,<h3>
, etc.) helps ensure that your document has a clear and consistent hierarchy. -
Use ARIA landmarks such as
<header role="banner">
and<footer role="contentinfo">
to provide additional information about the purpose of each section to assistive technologies.
Here is a web accessibility evaluation toolπ to check your webpage for any remaining errors or warnings related to landmarks.
I hope you find it helpful!π Above all, the solution you submitted is π. πHappy coding!
Marked as helpful0 -
- @scroft001Posted over 1 year ago
I did something similar, created a child div containing the image that would overlay the actual NFT. Set the visibility to hidden then when the parent was hovered over I set the visibility to visible. It let me avoid setting the opacity of both the div and the image.
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord