Design comparison
Solution retrospective
It's my first time using the @media query, I didn't know about this responsiveness technique until today!
What challenges did you encounter, and how did you overcome them?I had an issue with the mainContainer element (basically the whole background) growing only as big as the content, although I gave it the style "height: 100%". Then I found out, I'd have to set the style "html,body{ height: 100% }" for the mainContainer to inherit the height.
What specific areas of your project would you like help with?- Is it usual to use style "html, body{ height: 100% }"? I have a personal project I've worked on where I didn't use this style and it still worked.
- When should I use the max-width property and when the min-width property in the @media query?
Community feedback
- @kodan96Posted 6 months ago
hi there! ๐
-
No, it's not usual and it's not good practice. If you want to center your content using Flexbox, and that's the reason why you want to set
height
on the body usemin-height
instead. If you use height and your content overflows (it can't fit in one screen height) on smaller screens, users won't be able to scroll down.min-height
will still let them to do so. I've never seen anyone setting height on thehtml
tag itself, but maybe I'm missing smg. -
Depends on what's your base style. So where you start. If you build your site using mobile-first workflow, then you should use
min-width
, otherwise at desktop-first you should usemax-width
.
Hope this was helpful ๐
Good luck and happy coding! ๐ช
0 -
Please log in to post a comment
Log in with GitHubJoin 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