Design comparison
Solution retrospective
I had no particular problems in building the grid for the desktop page but, strangely, I had problems in building the mobile one: to make the grid work I had to add "!important" to some classes. I'm sure I made some mistakes, so if anyone would like to open my mind and give me some suggestions to improve it, it will certainly be welcome!
Community feedback
- @AgataLiberskaPosted over 3 years ago
Hi @AndreanaPerla! I think you had to use
!important
because your media queries are clashing with each other. One of them ismax-width: 375px
(that's 0 to 375px) and the other ismax-width: 1440px
(that covers 0-1440px). The second one comes later in the stylesheet, so it will override style rules if they have the same specificity.When you change those, make sure to check how things are displayed on different screen sizes (you can do that in dev tools in your browser). Your grid layout scales down to fit the screen after that 375px breakpoint, but it makes it so small it's impossible to read. And after the second breakpoint (so wider than 1440px), some of the styles disappear and the grid changes into a column again.
Hope this helps, if something is not clear let me know and I'll do my best to help :)
1@AndreanaPerlaPosted over 3 years agoThank you so much @AgataLiberska! I completely forgot that css gives priority to the queries that comes later! I'm still a newbie TT_TT I changed the order of the media queries and now it's much better ;) thanks again
0@AgataLiberskaPosted over 3 years ago@AndreanaPerla no worries, happy to help :)
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