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-preview-card-component using CSS Grid and Flex box

@DreamCoder7

Desktop design screenshot for the NFT preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Community feedback

T
Grace 29,310

@grace-snow

Posted

I've had a look on a smaller screen and inspected the code and notice some other important foundational issues with the way you're styling this. It looks very broken on my phone.

Here are some changes I made in browser that should help:

.card {
  /* grid-template-columns: 300px; */
  grid-template-columns: minmax(auto, 300px); // let it grow up to a point but be small if it needs to be
}

.container {
  /* max-width: 144rem; */.    // no reason to do this
  /* height: 100vh; */
  /* align-items: center; */
  /* justify-content: center; */
  min-height: 100vh;   // never limit height or items will overlap
  place-content: center; // more succinct
  padding: 1.5rem;  // in this case you don't want the card to touch screen edges
}

html {
 font-size: 62.5%
 // Gah ! Don't do this. No reason to and it creates an accessibility nightmare if you arent really careful;
}

Marked as helpful

2

@DreamCoder7

Posted

@grace-snow Thanks, it's help full but i set the font-size on html cause when user change the default value (which is 16px) on browser, it also change the page style that is way.

0
T
Grace 29,310

@grace-snow

Posted

@redstorm-hub it’s really really bad for accessibility, please don’t do that unless you know what else you need to do to correct it for people who need the default font size.

The correct way to do it is keep rems as they are, keep html or :root font size at 100% (or larger is ok for large screens)

Then change the base font size using rem on the body. This can have the same result for most users but doesn’t put the site at an accessibility risk for those with vision impairments who can use a variety of different zoom or text settings to make your site work for them

0
T
Grace 29,310

@grace-snow

Posted

So this looks great.

But there is a big problem with the UX and semantics. Lots of hover effects but no interactive elements! Hovers indicate interactivity. Give me some anchor tags! ;)

2

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