NFT Card with CSS Grid

Please log in to post a comment
Log in with GitHubCommunity feedback
- @markteekman
Hey Haico,
Great work once more on this challenge! You can definitely see your CSS Grid skills improve :) I like how you kept the HTML very minimal and used the power of Grid to handle the structure of the layout.
Some small improvements:
- On smaller screens (phone for example) the attribution footer lays over your card because you've used
position: fixed
. You could try something like a sticky footer solution, where it's still at the bottom on large screen sizes but stays below the main content on small screen sizes. - When viewing the component on a small screen size the card overflows the viewport. This is because you've set a fixed
width: 375px
on themain
element. Try to avoid setting it explicitly as much as possible. Settingmax-width: 375px
solves this. - Try to include a CSS reset in your project, not including one can often lead to differences between browsers. A good example is trying to implement the sticky footer I mentioned. You can see in Firefox that the body has some margin which results in the footer overflowing the viewport because of the
width: 100vw
the footer has. There are many options, a simple one is all you need. - When using
alt=""
attributes on images, check whether is makes sense to put it there. For example, you havealt="image of Jules Wyvern"
on the avatar, followed by the text 'Creation of Jules Wyvern'. A screen reader would now read 'image of Jules Wyvern Creation of Jules Wyvern'. So here, it's better to have an emptyalt=""
tag. If the avatar image wasn't accompanied by any text it would make sense to set the alt tag to describe it to the user. - Another accessibility concern is that your anchor links aren't distinguished in this component. 'Equilibrium #3429' and 'Jules Wyvern' are links, but this is not visually notable. Consider adding an underline to them.
All in all, it's a great looking component!
Happy coding :)
Marked as helpful - On smaller screens (phone for example) the attribution footer lays over your card because you've used
- @markteekman
Haico, just figured I forgot one addition, you can add
cursor: pointer
to your.header:hover .view-container
class to add that extra level of interaction taken from the design :)
Join 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