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

Preview Card Component

semantic-ui
Akshay Magrani•975
@akshaymagrani
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

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

    I can confirm this is spilling off the screen on my phone.

    You also need to change the html on this. I can see you're trying to use semantic elements, but using header and footer in this kind of component can actually damage accessibility rather than help it. It could work better if you'd used article instead of section but I still think it's unnecessary

    The most important html structure for accessibility is headings, followed by using the right kind of interactive elements where required

    That brings up the next important html issue. This is missing anchor tags for wherever there are hover styles. Those elements will then need focus visible styles too, once they've been made interactive

    Read up on how and when to write alt text on images and how to make inline svgs accessible. They'll either need aria-hidden if meaningless or labelling appropriately if meaningful.

    Good luck

    Marked as helpful
  • Vanza Setia•27,715
    @vanzasetia
    Posted over 3 years ago

    👋 Hi Akshay!

    🎉 Congratulations on finishing this challenge!

    Like Grace and Ricardo have mentioned about the overflowing issue on small screen size, I would recommend adding padding to the body element to prevent the card fill the entire page on mobile view.

    Some feedback from me:

    • Accessibility
      • All elements that have :hover or :active states should be interactive elements, which in this case they should link elements. It is also recommended by me to create a custom :focus-visible styling to any interactive elements (button, links, input, textarea). This will make the users can navigate this website using keyboard (Tab) easily.
      • Always wrap text content with meaningful tag (p). span and div should only be used for styling purposes.
      • Read this tutorial from W3 WAI about images. It will teach you how to write a meaningful alternative text and a lot of stuff about images. Also, I recommend reading this ultimate guide about the alternative text by Axess Lab.
      • Your attribution should be the footer (not the content inside the card).
      • Use rem or sometimes em unit instead of px(especially font size). Using px will not allow the users to control the size of the page based on their needs.
    • Best Practice (Recommended)
      • Put all the styling on a separate stylesheet. The presentation (HTML) and the styling should be separated.
    • Styling
      • I would recommend making the body element as a flexbox container to make the card in the middle of the page. It's much simpler than using the absolute positioning method.
    /**
     * 1. Make the card vertically center and
     *      allow the body element to grow if 
     *      needed
     */
    body {
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 100vh; /* 1 */
    }
    

    That's it! Hopefully, this is helpful!

    Marked as helpful
  • Ricardo Magalhães•180
    @AmodeusR
    Posted over 3 years ago

    You need to work on your mobile version! It's broken.

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 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

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