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 using flexbox!!!

P

@NONAlish

Desktop design screenshot for the Stats preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


The task is not particularly difficult, I advise everyone.

Community feedback

@AGutierrezR

Posted

Hello there 👋. Good job on completing the challenge!

I have some suggestions about your code that might interest you.

General Structure and HTML:

  • Wrap the .container in a <main> tag. All the content should be contained within landmarks. Every page minimally needs a <main> element.

  • Consider using <picture> tag that is commonly used for responsive images, here you can specify the difference image sources for different screen sizes and devices. For example:

    <picture>
      <source media="(min-width: 1399px)"srcset="/images/image-header-desktop.jpg">
      <img src="/images/image-header-mobile.jpg" alt="">
    </picture>
    

    Check that srcset and src are correct and change the media if you want the desktop image to kicks in on a previous or later screensize.

CSS and Styling:

  • The mobile fonts are to big and makes the content to overflow the screen, fix the mobile font size.
  • Add a overflow: hidden to the .container to prevent the image to bleed out the card.
  • Instead of fixed widths, employ max-width and min-width for flexible and responsive design.
  • Let the content decide the height of the elements. Use padding and margins strategically for this purpose.
  • The body should not have its height limited. Instead of using height: 100vh, use min-height: 100vh.

I hope you find this helpful 😁. Most importantly, your submitted solution is fantastic!

Happy coding!

0

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