Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Stats preview card component (flexbox)

@agelitaeme

Desktop design screenshot for the Stats preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Community feedback

@VCarames

Posted

Hey @agelitaeme, regarding your question

You can do what I did in my challenge:

https://www.frontendmentor.io/solutions/stats-preview-card-component-css-flex-GSK0z5NEPe

Some suggestions to improve you code:

  • Reduce the border-radius to better match the FEM example.

  • The stat numbers are not headings. They should be wrapped in a Paragraph Element.

  • You do not want to have or use empty divs in you HTML code, since this is considered to be bad practice. Instead use the Picture Element

Picture Element will allow your to switch between images in different breakpoints

Syntax:

  <picture>
    <source media="(min-width: )" srcset="">
    <img src="" alt="">
  </picture>

Source:

https://www.w3schools.com/html/html_images_picture.asp

https://web.dev/learn/design/picture-element/

  • In mobile view, there is a lot of space around each text section that needs correcting.

  • Implement a Mobile First approach 📱 > 🖥

With mobile devices being the predominant way that people view websites/content. It is more crucial than ever to ensure that your website/content looks presentable on all mobile devices. To achieve this, you start building your website/content for smaller screen first and then adjust your content for larger screens.

Happy Coding! 👻🎃

Marked as helpful

1

Please log in to post a comment

Log in with GitHub
Discord logo

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