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-main using basic HTML and css

abhinavrai10β€’ 90

@abhinavrai10

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


Need feedback on reducing code length. If there is any way? Also need feedback on code quality.

Community feedback

Vanza Setiaβ€’ 27,795

@vanzasetia

Posted

Hi there! πŸ‘‹

The most important thing is the quality not the quantity. So, I don't think you need to think about the code length of this project.

Here are some suggestions for improvements.

  • The image is a decorative image. So, leave the alternative text empty (alt="").
  • Swap the img aside with a div. aside should be used to wrap any content that is not the main content.
  • All the page content should live inside the main element.
  • The statistic numbers are not headings. You can wrap each of them with span instead.
  • Never use 100vw on the body as it doesn't account for scrollbars when present. It may only ever introduce potential overflow/scroll bugs.
  • Never limit the height of the body element. It will not allow the users to scroll the page if the page content needs more height. You can see the issue by looking at the site on a mobile landscape view. So, my recommendation is to use min-height instead.
  • I highly recommend writing the styling using the mobile-first approach. It often leads to shorter and better performance code. Also, mobile users won't be required to process all of the desktop styles.

I hope this helps! Happy coding!

Marked as helpful

1

abhinavrai10β€’ 90

@abhinavrai10

Posted

@vanzasetia Thank you so much for taking out time and writing such a helpful feedback. I have made some changes based on your recommendations. I hope its better than before. I will surely try "mobile-first" approach from my next projects.

0
Vanza Setiaβ€’ 27,795

@vanzasetia

Posted

@abhinavrai10

You are welcome! πŸ‘ Happy to know that was helpful! 😊

I wanted to take a look at the updated solution. But, it's giving me a 404 page. Then, I found the correct URL, so I recommend updating the live site URL.

Here is the comparison between the two URLs.

Great job on improving the site! πŸ‘ Keep it up! πŸ‘

0
Lucas πŸ‘Ύβ€’ 104,420

@correlucas

Posted

πŸ‘ΎHello , congratulations on your solution!

Nice code and nice solution! You did a good job here putting everything together. I’ve some suggestions for you:

To get closer to overlay effect on the photo as the Figma Design its better you use mix-blend-mode. All you need is the div under the image with this background-color: hsl(277, 64%, 61%); and apply mix-blend-mode: multiply and opacity: 80% on the img or picture selector to activate the overlay blending the image with the color of the div. See the code bellow:

img {
mix-blend-mode: multiply;
opacity: 80%;
}

Here's a good article explaining these effects with mix-blend-mode: https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode

✌️ I hope this helps you and 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