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

battling with font sizes, a rather messy solution for the card preview

@baturalperbay

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


What challenges did you encounter, and how did you overcome them?

It was hard to make texts scale down with the flexbox. When flexbox shrank, the box of the text elements would shrink aswell, however the text inside would not. They continued to have the same font size, and this would make the contents of the flexbox overflow. I tried using vw's, em's, rem's and in the end I settled with using cqi font sizes.

I also attempted to use @container to make the font sizes change with the container's width or height. However @container required container-type: inline-size to be used (if you want to check width), and that would break the whole projects font sizes, so I had to find a new solution.

Community feedback

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