NFT preview card component using flexbox and utility classes
Design comparison
Community feedback
- @grace-snowPosted over 1 year ago
I think you're really close with this one! Most of the HTML and CSS is great, but there is one glaring issue to me...
That image has a cursor pointer and hover effect on it, which implies it should be clickable. Yet you've only used a div. Think through how to do that bit accessibly. That's the real challenge with accessibility here...
Also, when writing alt text, you shouldn't need to include words like "image". It's already an image role. That avatar image would currently be announced to screenreaders as "image, Jules Wyvern Avatar image".
Marked as helpful1@DevShaunBPosted over 1 year ago@grace-snow Thanks for the feedback.
I did think about making the image more accessible here. I can either use an anchor tag (assuming it will go to a different page), or I can use a button (assuming it will open a modal) instead of a div wrapper. I was also thinking about adding some sr-only visually hidden text to inform the user which card is focused (assuming an actual website will have a bunch of these cards).
Regarding the avatar image, will fix that right away.
0@grace-snowPosted over 1 year ago@DevShaunB I'm not sure why you'd need visually hidden text on this... Unless you mean for the button action perhaps? Maybe Im not understanding
0@DevShaunBPosted over 1 year ago@grace-snow I updated it. I used an anchor tag with aria-label to wrap the image.
1
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