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

NFT-Card HTML and Tailwind CSS [project #4 submission-4]

Zou•190
@zouvier
A solution to the NFT preview card component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What i learned:

  1. transition effects /w images and color
  2. how to use span properly to align images and text together
  3. Getting grid items to share the same row and col
  4. how to properly set up fonts and sizes thanks to: https://wizardry-technique.webflow.io/

Overall was a good learning experience!

[UPDATE - 1]

  1. switched to tailwind css
  2. made it responsive and will work with any screen down to 375px
  3. learned about rgba
  4. gained a more nuanced understanding of when to use flex vs grid.
  5. should be more in line, but will fix smaller aesthetics in next submission

[UPDATE -2]

  1. fixed accessibility issues
  2. focus now works for all hover effects
  3. image overlay is now responsive and scales with screen
  4. fixed minor aesthetic issues

[UPDATE -3]

  1. all accesibility issues are now cleared
  2. card now matches design
Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Grace•32,130
    @grace-snow
    Posted over 2 years ago

    Hello

    There's a few issues on the html in this which are causing accessibility errors

    1. Every img must have an alt attribute. Look up how to use it correctly for important vs decorative images

    2. The link needs to wrap the whole image - try focusing on keyboard and see what happens

    3. The hover style should also happen on focus-visible

    4. The link wrapping the image has no accessible name. Search engines and screenreaders would have no idea what that link does

    5. You are using padding to separate items (create outside space) instead of margin

    6. Do not give your card a min-width. There is no need. Just a max-width. This is overflowing my mobile screen at the moment and hitting screen edges. Instead the card should have a max-width only and some margin around it. The image/overlay div inside should not have an explicit width either - just width 100%

    7. You are missing a heading element. The anchor tag on the title should be within this heading

    8. Inline svgs that are decorative need aria-hidden="true" focusable="false" on them

    9. Make use of gap and justify content to create horizontal spacing between the price and time elements, no weird calc margins are needed

    10. Every page must have a main landmark

    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

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 all CSS, SCSS and Less files in your repository.

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.

How does the JavaScript validation report work?

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

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.

Frontend Mentor for Teams

Frontend Mentor for Teams helps companies and schools onboard and train developers through project-based learning. Our industry-standard projects give developers hands-on experience tackling real coding problems, helping them master their craft.

If you work in a company or are a student in a coding school, feel free to share Frontend Mentor for Teams with your manager or instructor, as they may use it to help with your coding education.

Learn more

Oops! 😬

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

Log in with GitHub