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

Responsive Stats Preview Card Component Using CSS Grid

@shamilussainc

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


Hey guys, here is my 4th frontendmentor project. I am enjoying the journey. Please take a look at my solution. Where i am using two separate image tags for mobile and desktop view. And showing corresponding image based of the screen width. is that the right way to do it ? Or any better solution? your feedback is important. Thank you.

Community feedback

@MinhKhangTran

Posted

Hi Shamil Ussain C, nice solution!

If you want to use responsive images you can use picture and source with srcset tags in your html.

For example:

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

I found a helpful article at mdn. If you are interested you can read there more.

I hope this helps. Keep going and have fun 🥰.

Marked as helpful

0

@shamilussainc

Posted

hey @MinhKhangTran , I have read the article and it found really useful. thank you for sharing it with me and thank you for your feedback.

happy learning 😊

0
teamie 470

@tea-scripts

Posted

Great job completing the challenge. Just some points:

  • Nesting is one of the beautiful features of SASS but try as much as possible not to always nest too deep. Might become hard to find things.
  • Also try not to nest in the body. Keep only default styles in the body. Default styles like line-height, default color, default font-family etc. should be the styles in your body then you can overwrite them later outside of the body wherever you'd need to.
  • You might also want to consider using sematic HTML like article in place of the divs. For instance your card is considered an article in semantic HTML. Learn more about HTML Semantics here.

Overall you did an impressive job. Keep pushing and happy coding 👍!

1

@shamilussainc

Posted

Hey @coder-teamie , thanks for your feedback. it will help me to improve my CSS skills. i will try to follow these instructions.

happy coding 😊

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