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

Stats preview card component | Responsive | HTML & CSS

Tushar Biswas•4,060
@itush
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 enjoyed coding the media query part the most of this challenge.

I'd really appreciate if you could answer the following:

What did I do wrong? What did I do right? How can I improve? Thanks in advance :)

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Julian Krüger•100
    @juliankruger
    Posted over 3 years ago

    Hi Tushar,

    this might look as much but trust me, it's not! The second paragraph is more important and easy to fix.

    Your design looks really good and it's close to the challenge. The image is a bit stretched and with varying screen size it gets squished. (Looks fine on the two targeted screen sizes, though) A possible solution is to use the image as a background-image in CSS. With background-blend-mode you can also take control of the coloring a bit more and with background-position you can control the position.

    Anyway, the more important issues at hand (that are also way easier to fix) are the Accessibility and HTML issues in your report.

    Accessibility: That div at the bottom should be a footer, it helps the semantic structure of the page and boosts accessibility.You also used the <main>-tag, that is nice!

    HTML: The article tags are misused as stated in the report. This is some data that is for itself just a single statement, it doesn't contain a heading. An article should be something that could be viewed on its own completely, like the whole card for example - with a heading and more content. But on the upside: You didn't fall into the trap turning the big texts of the data into headings. These are maybe paragraphs or items of a list of features. Wrapping the "1k+" and the "companies" in one tag was the right move, but the tag should be a <p>- or <li>-tag in my opinion.

    I hope that helps, have a great day!

    Greetings!

  • Ya.•50
    @Ya911
    Posted over 3 years ago

    nice

  • Aakash Verma•9,500
    @skyv26
    Posted over 3 years ago

    Hi! Tushar, I hope you are well and good. I gave few feedback on your work already and now I again I am going to tell you about your design. You made it really well. As you can see you are pretty close to the preview design. But still I would say focus on detailing. Like 12M+ there you used small letter 'm'. Why it is so important to focus on this little thing ? Answer is to test your skill on CSS. Now I am going to tell you some other issue .

    In mobile view your left container text is going little bit towards right handside, in short, not aligned to center hoizontally. And I found problem below:

    .left {
        background: var(--Dark-desaturated-blue-cardbg);
        flex: 1;
        margin: 10% 0% 10% 10%;
        border-top-left-radius: 10px;
        border-bottom-left-radius: 10px;
        padding: 5% 0% 5% 5%;
    }
    

    you can see you missed adding 5% and used 0%.

    padding property structure.

    padding: TOP, RIGHT, BOTTOM, LEFT;

    just use

    padding: 5%; and your text will be in center position

    I hope you understand and solve your issue. Again I would say if you really wanna get client then focus on your skills.

    Good Luck

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.

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