Submitted about 3 years ago
NFT preview card component using Flexbox and Grid
@mohamadadithya
Design comparison
SolutionDesign
Solution retrospective
Your feedback is useful for me :).
Community feedback
- @pikapikamartPosted about 3 years ago
Hey, great work on this one. Layout in general looks great!
Some suggestions would be:
- Avoid using
height: 100vh
on a large container like thebody
as this makes the element's height capped based on the viewport/screen's height. Instead usemin-height: 100vh
so that the element will expand if it needs to. - For this, it would be great to have a
main
tag that will nest the.card
selector. This way your site will have a main-landmark. - Change the
section
into usingdiv
, supposing this would be a real site, there would be lots of.card
and you don't want each of them to usesection
tag. - Since you are treating the image as an interactive component since there is the hover state and whatnots , consider having an interactive element like a
button
ora
tag to be partner with the image. But I don't suggest wrapping theimg
with the element since the image inside it has a text, I would go for something like:
<div class="nft__container"> <a href="#"> <span class="visually-hidden">View Equilibrium nft</span> </a> <img src="" alt=""> # nft image </div>
The
a
tag's pseudo of::after
will beposition: absolute
and take full width and height of the.nft__container
so that the whole nft will be clickable. The view-icon will be thebackground
of the::after
as well. This might seem confusing hehe but I don't have a reference since I can't do this challenge(pro) but it goes something like that.- It would be great to have a screen-reader only
h1
in this page. Theh1
would be the first text of the supposedmain
tag and will describe what is the main-section is all about. Since this is like a nft previews, it could be:
<main> <h1 class="visually-hidden">NFT preview collections</h1> .... ... </main>
- I almost forgot, the view-icon is just decorative. Decorative images should be hidden for screen-reader at all times by using
alt=""
andaria-hidden="true"
to theimg
tag or onlyaria-hidden="true"
if the image is usingsvg
. - When using
img
tag, you don't need to add words that relates to "graphic" such as "icon" and others, sinceimg
is already an image so no need to describe it as one. - Use only
Ethereum
as thealt
of the eth icon. - This text
0.041 ETH
should be inside ap
tag. When wrapping up a text-content, make sure that it is inside a meaningful element likep
tag or heading tag and not using likediv, span
to wrap the text. - The clock-icon is only decorative so hide it using the method above.
- Person's image should be using the person's name as the
alt
value likealt="Jules Wyvern"
. Components like this where a person's information is presented, make sure to use their name as the person'simg
alt
value.
Aside from those, great job again on this one.
Marked as helpful0@mohamadadithyaPosted about 3 years ago@pikamart Okay, thank you for your advice/feedback. I will fix it later ;).
1 - Avoid using
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