Design comparison
Solution retrospective
How do I properly calculate the height of a document for multiple devices? Ex: If I test on a Moto G4 screen (browser tool) it is ok. If I test on a Pixel 2XL is not ok. I don't know why... :/
Community feedback
- @mattstuddertPosted over 4 years ago
Hey Vitor, nice work on this challenge! You don't need to calculate the heights yourself, you just need to remove the set heights that you've added.
For example, you've got
height: 630px;
on the.content
class. You've also gotheight: auto;
andmax-height: 731px;
on thehtml
andbody
. Remove those and you'll see the height of the content grows and the curved pattern in the bottom left sticks to the bottom on mobile.I'd also recommend removing the
max-width: 375px;
from thehtml
andbody
as it's restricting the width of the content for mobile devices. I normally prefer to have a.container
class that is fluid all the way up to a specified pixel value.For example:
.container { margin: 0 auto; /* centers content */ width: 95%; /* fluid container for smaller devices */ max-width: 1240px; /* controls max width of content for larger screens */ }
This container can then be wrapped around content to control its width and make sure it's displayed correctly.
I hope this helps. Keep up the great work! 👍
1@vitormarcalPosted over 4 years ago@mattstuddert thanks for your feedback. I corrected and in the next challenge I will think in these terms too :)
1
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