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

Simple responsive card using media quer

P

@hphemanathan

Desktop design screenshot for the Stats preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Community feedback

T
Grace 29,310

@grace-snow

Posted

Hi

Try to improve the html on this

  • use landmark elements like main
  • use a heading element
  • use img srcset or the picture element for the image
  • use an unordered list with 3 items for the stats
  • remove brs, use a span set to display block wrapping the word or number, no need for brs

This will set you a good foundation

It's good practice to use a css reset at the start of css every time. That would do things like change images to display block instead of inline block. That will fix the slight gap I see under the image on mobile.

Good luck

2

T
Grace 29,310

@grace-snow

Posted

Some really quick css tips

  • never ever have font size in px. Use rem
  • no need for the pseudo to use mix blend mode. You can just have the background color on that half of the card
  • you'll have better control letting things be 100% wide and using max-width in rem. If you use % widths all the time on bigger projects elements will gradually end up misaligned with each other
  • no need for large margins. Just use flex or grid to center content on the page, along with either a little margin on the component or padding on the wrap ung element to stop content hitting screen edges

Marked as helpful

1
P

@hphemanathan

Posted

@grace-snow Thanks Grace will follow the tips

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