Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

NFT card using @media tag for responsiveness

Noviβ€’ 10

@nlorens

Desktop design screenshot for the NFT preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Total newbie here! I am having trouble making it responsive, any advice/feedback is much appreciated. Also if there are ways to code the layout more efficiently? Any comment is welcomed :)

Community feedback

Amonβ€’ 2,560

@A-amon

Posted

Hello! Great effort~ πŸ˜‰

Here are some suggestions( or things I think can be fixed)

  • Remove the height setting from .card. Instead, set the height for the image, either in px or other units. I don't recommend using vh or vw for this height. πŸ˜€
  • Remove top setting from .card. Then, set the body's height to 100vh. (The card is now at center for any size πŸ₯³)
  • You are missing h1 and h2 elements. Maybe put a h1 element containing the challenge's title like <h1> NFT card challenge </h1> and hide it using a screen-reader only πŸ‘ class (You can check these out - Ref1, Ref2. Also, read this to find out about heading tags' usage.
  • To center vertically, the icon and text inside .eth and .time respectively, you can give those two classes this: display:flex; align-items:center;.
  • Instead of using position:absolute; right:1.5em; on .time to align it to the right, maybe you can try out justify-content:space-between; on .feature. πŸ˜‰

Awesome work! πŸ˜€

Marked as helpful

0

Noviβ€’ 10

@nlorens

Posted

Hi @A-amon !

Thank you so much for your feedback! I really appreciate it. My code looks more clean now after using display:flex as you have suggested. And the result looks neater. I struggle with aligning items, as you can see from my code, I tend to code it too specificπŸ˜‚ and it becomes less responsive. Happy to learn new ways to align/centering things!

Wow I didn't know that h1 is very important, so thank you for highlighting that! I need to spend some time to read the links that you shared and then I will also add the h1 tag to my solutionπŸ˜ƒ

Regarding your first point, why you don't recommend using vh for the height?

0
Amonβ€’ 2,560

@A-amon

Posted

@nlorens It will surely get better over time! πŸ˜‰ About the vh for this image's height, it would be because different devices might have different heights so it would be hard to keep this image's appearance consistent on all of them if you use it. πŸ€” This is just my opinion tho πŸ˜‚!

1
Noviβ€’ 10

@nlorens

Posted

thank you @A-amon 😁

0
Amonβ€’ 2,560

@A-amon

Posted

@nlorens Glad to help!

0

Please log in to post a comment

Log in with GitHub
Discord logo

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