NFT preview card component (π¬ HTML & CSS)
Design comparison
Solution retrospective
Hello community!
This is my solution for the NFT preview card component challenge.
Very insteresting project and quite challenging with the switch of pictures when hovered. I spend litteraly hours between researching and trying (but learn a lot about pseudos, anchor and positioning in the process).
I finally found an interesting solution proposed by Vanza Setia, so thanks to him π.
Otherwise, no other issue encountered!
I'll be happy to hear any feedback and advice!
Community feedback
- @PhoenixDev22Posted about 2 years ago
Hello
Congratulation on completing this challenge. Excellent work! I have few suggestions regarding your solution, if you don't mind:
HTML
- The link wrapping the equilibrium image should either have
Sr-only
text, anaria-label
oralt
text that says where that link takes you.
- For any decorative images, each img tag should have empty
alt=""
and addaria-hidden="true"
attributes to make all web assistive technologies such as screen reader ignore those images in(icon-ethereum, icon-clock ).
- Profile images like that avatar are valuable content. The alternate text of the avatarβs image should not be Avatar, itβs meaningless. You can use the creator's name
Jules Wyvern
. Read more how to write an alt text
- The alternate text should not be hyphenated, it should be human readable.
- If you wish to draw a horizontal line, you should do so using appropriate CSS. You may remove the
<hr>
, you can useborder-top:
to the avatar's part.
- There are so many ways to do the hover effect on the image, The one I would use is pseudo elements
::before, ::after
. You can use pseudo-elements to change the teal background color to hsla. Then the opacity can be changed from 0 to 1 on the pseudo element on the hover. Also using pseudo elements makes your HTML more cleaner as there's no need for extra clutter in the HTML.
Great job on this one. Hopefully this feedback helps.
Marked as helpful0@alexandre-jolietPosted about 2 years agoHello @PhoenixDev22!
Thank you very much for your feedback! I have fixed my code accordingly π.
Very interesting readings you gave me! Initially, I was thinking naively that every picture needed an alt text but I had no clue about their actual, and I suppose true purpose, for Accessibility.
And nice tip for the line! I didn't think to create it with the border of an adjecent element.
Thanks π!
1 - The link wrapping the equilibrium image should either have
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