Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 2 years ago

NFT Preview Card Component

Jason Solarz•60
@JasonSolarz
A solution to the NFT preview card component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)
Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • P
    Jeff Guleserian•500
    @jguleserian
    Posted over 2 years ago

    @JasonSolarz

    Jason,

    I liked the look of your solution for the NFT Preview Card Challenge. Specifically:

    • your html structure is clean and simple, and thus easy to follow
    • likewise, your CSS is minimalist and easy see the relation with your HTML
    • the card itself looks identical to the original

    On the other hand, I was curious as to why you did not code the overlay on the top image, the hover effects on the title and creator's name, or the @media breakpoints. Perhaps this is only your first draft and you have more coming. Having access to your README.md file would have been helpful in this respect. I'll assume you have more coming, but if not, if you left them out because you are still working on those skills, let me know and I can suggest some resources. That said, I do have a few suggestions that may help in terms of best practices:

    • Screen readers will want to see an <h1> title in the body element so they can announce the subject/topic of the page. Most users don't need this, of course, so you will want to hide the <h1> from site. You can accomplish this by adding a class, like "sc-only," and then in the CSS, something like:

    .sr-only { position: absolute; top: auto; height: 1px; width: 1px; overflow: hidden; }

    • because pixels may cause issues with accessibility, it seems to be common practice to use em or rem instead. There is still some discussion out there about it, but there are legitimate reasons to favor these more versatile measurements. If you are interested, you might take a look at EM vs REM vs PX – Why you shouldn't “just use pixels”
    • I think the challenges assume that when you use components, as opposed to entire sites, that the component be centered vertically and not just horizontally. To do this, I recommend that in your main container, the one that will house your component, you use a grid and justify and align the content, something like: *container* { width: 100 vw; min-height: 100vh; display: grid; justify-content: center; align-content: center; }

    I hope these suggestions help in some way. I'm sure you have resources that will help you with the breakpoints, overlays, and hover effects, but if not, or if I can be any help at all with those matters, please respond and let me know.

    Again, impressive job on recreating original model. Happy coding!

    Jeff

    Marked as helpful

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
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit 1st-party linked stylesheets, and styles within <style> tags.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub