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

Single price grid component - CSS Grid and custom properties

dkaffesā€¢ 140

@dkaffes

Desktop design screenshot for the Single price grid component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


šŸ™ Please enlighten me! The Sign-up <a> element breaks to a two-line text at 360px. And as the width becomes smaller the whole button breaks because of its padding settings.

  • What is the smallest width that we need to ensure the design is ok and does not break? Is it 320px?
  • Does it make sense to create more media queries for widths smaller than 320px?

My query is general and not only for these FrontEnd Mentor challenges.

Thank you!

Community feedback

Daniel šŸ›øā€¢ 42,650

@danielmrz-dev

Posted

Hello @dkaffes!

Your solution looks great!

About your question:

- Please enlighten me! The Sign-up <a> element breaks to a two-line text at 360px. And as the width becomes smaller the whole button breaks because of its padding settings.

šŸ“Œ First: You can decrease the padding on the X axis a little bit. 5.5rem is a lot of padding šŸ˜…

šŸ“Œ Second: Add white-space: nowrap: to it. It'll prevent from breaking the row.

I hope it helps!

šŸ›ø

Marked as helpful

1

dkaffesā€¢ 140

@dkaffes

Posted

Hi @danielmrz-dev!

I know that 5.5rem is a lot of padding šŸ˜‚! I was just trying to emulate the design given!

Thanks for the tips! Pretty useful!

1
Daniel šŸ›øā€¢ 42,650

@danielmrz-dev

Posted

@dkaffes

An alternative solution for not using that much padding is to set the button's width. By doing this, you won't need horizontal padding šŸ˜Š

0
P
Edā€¢ 720

@EdwinSch

Posted

Hi dkaffes Nice work on your challenge. So first of; writing good queries is a hard part of front-end development in general as we have to deal with so many devices and screen sizes these days. And there aren't any "set rules" on minimums or maximums, it's mostly up to the UI design(er). But we could say most phones will deal with 300px width and upwards. Some very recent exceptions are the Samsung Fold models for example.

For your button in this case you could switch the width to auto or percentages and let it scale by the witdh of the parent and maybe loose some padding below a certain point.

Some tips in general for really small screen sizes:

  • scale down font sizes
  • break off texts if needed
  • make paddings or margins as small as possible
  • scale down gaps or line-heights
  • scaling by percentages of parent

Alternatively there is always the option to not show anything at all below a certain point. I see a lot of apps doing this recently where below the range of 300px the body just shows a message like: 'please view on a bigger device' for example.

Hope this helps :)

Marked as helpful

0

dkaffesā€¢ 140

@dkaffes

Posted

Hello @EdwinSch!

Thanks for the tips!

I will definitely keep them in mind for my next challenge!

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