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 Preview Stats Preview Card Component (CSS Grid / Flexbox)

@Slaks97 180

@Slaks97

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


I would be grateful for any feedback!

Community feedback

@Chermann-KING

Posted

👋Hi @Slaks97

I think you've already done a great job👌 in terms of accessibility.

Here are a few suggestions for improving your code:

- HTML:

Caching of external resources, such as Google Fonts, could be improved. You can add rel="preload" attributes to preload these resources and improve performance.

- CSS:

1. Use CSS variables: CSS variables let you define reusable values for text styles, such as font size or color. By using variables, you can guarantee style consistency and facilitate subsequent modifications.

2. Units: Instead of using a fixed font size in pixels (px) as in the body, you can use a relative font size in em or rem. Use relative units of measurement (em, rem) for font size to create flexible and adaptable text styles, simplifying global adjustments of text size in your project.

3. Use reusable classes for text styles: If you have similar text styles that are repeated in several elements, you can create reusable classes. This avoids repeating the same styles in different CSS selectors, simplifying code and facilitating subsequent updates.

4. Use more targeted selectors: In some cases, you can use more specific CSS selectors to apply specific styles to certain text elements. This saves you having to add additional classes to your HTML elements. You can use selectors based on the structure of your HTML to precisely target the desired elements.

The aim of these suggestions is to improve the maintainability, consistency and reusability of text styles in your CSS code. By following these best practices, you can make your code cleaner, easier to understand and easier to maintain. This is very useful when working on projects that are likely to evolve, for example.

Apart from these few tips, your code looks well structured and functional.

Good code😉

Marked as helpful

0

@Slaks97 180

@Slaks97

Posted

Thank you so much for the thorough feedback @Chermann-KING, most helpful...and most grateful!

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