Design comparison
Solution retrospective
I am not able to center it in the center of the whole view ,can anybody help on that?
i used media query to make it responsive ,is there any other way it can be done ?
Feedbacks are welcome
Community feedback
- @parimaldesignPosted over 1 year ago
Hello @khushi0909, Congratulations on completing the Challenge. I checked the live solution and I would like to make some suggestions. You have to use the font - family called Outfit from Google Fonts. You have set the width of the card as - 20vw which will look fine on Laptops and Desktops but it will shrink too much on mobile devices with very little width since 'vw' relates to Viewport width. I'd suggest setting a min-width to some pixel value to make it responsive.
Marked as helpful1 - @Mariusq17Posted over 1 year ago
Try to put at body
min-height: 100vh
to make the body to align the card to center on the entire screen.Marked as helpful1@khushi0909Posted over 1 year ago@Mariusq17 hey thanks it worked ,Thanks a lot .
but do you know what happens by putting min-height?
0@0xabdulkhaliqPosted over 1 year agoHello @khushi0909 👋. Congratulations on successfully completing the challenge! 🎉
- I have some recommendations regarding your question "what happens by putting min-height?" that I believe will be of great interest to you.
MIN-HEIGHT 📐:
- We want to use
min-height: 100vh
forbody
instead ofheight: 100vh
. Because setting theheight: 100vh
may result in the component being cut off on smaller screens, such as a mobile phone in landscape orientation.
- For example; if we set
height: 100vh
then thebody
will have100vh
height no matter what. Even if the content spans more than100vh
.
- But if we set
min-height: 100vh
then the body will start at100vh
, if the content pushes thebody
beyond100vh
it will continue growing. However if you have content that takes less than100vh
it will still take100vh
in space.
.
I hope you find this helpful 😄 Above all, the solution you submitted is great !
Happy coding!
Marked as helpful1@Mariusq17Posted over 1 year ago@khushi0909 Is not something complicated, but I think @0xAbdulKhalid has explaned you very good before I see your comment. His explanasion is very good, trust him.
Anyway, good work at your project and good luck on the future! 💪😎
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