Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 4 years ago

Preview Card Challenge

Rachel Opuba•10
@RachelOpuba
A solution to the Stats preview card component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


I have just completed my first challenge on this platform. Kindly review and let me know areas I can improve on, as I am a complete beginer. Thank you.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Grace•32,130
    @grace-snow
    Posted about 4 years ago

    Hi,

    It looks like you need to do quite a bit more work on this I'm afraid. Here are some suggestions

    • position centrally using flexbox / grid, not by using margins.
    • once that's done, add a little padding to the outer wrapper to stop content from hitting the sides
    • don't use width 60% on the component. Instead, give it a max-width in rem/px
    • Similar on each flex child. You don't need widths on those. Flex children can manage their sizing with flex-grow -shrink -basis if needed, or properties like min-/max- width
    • change the colors and sizes to match the design
    • font-family should include a fallback in the stack, not just one family name
    • you're mis-using ul/li elements in this. Each pair like '10K companies' could be one list item, not two. If using a list on here, you should only have one unordered list in the whole component. You can use spans to wrap the number and word separately to style if you want
    • try to use margin in only one direction (mostly) on your child elements like paragraphs headings etc. You will find spacings easier to control
    • images have to have alt text
    • font size must never be in px. You need to convert to rem (the font size you want / 16)
    • looks like border radius is missing. It can be on the component with overflow hidden set
    • to get the image looking closer, make it less opaque and add mix-blend-mode multiply

    Good luck

  • Gilang Aditya•425
    @madegilangaditya
    Posted about 4 years ago

    Hi, well done for your first challenge, I have little suggestion for your container border radius. Instead of put it on every div, better put in main class div and add overflow:hidden so your image will not overlap your main div border radius

  • Mike Doughty•25
    @YekimCodes
    Posted about 4 years ago

    Nice work!!

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