Design comparison
Solution retrospective
Hello, I am slowly getting the hang of HTML&CSS :D However on the desktop preview, there is this little weird dead space between the shadow and the card element that I didn't know how to fix. The card element height didn't want to get changed Can someone please explain to me what the problem is and how to fix it?
Community feedback
- @GioCuraPosted over 1 year ago
Hi! 👋 I took a look at your code, and what's causing the problem is the
min-height: 80vh
that you initially set on your.card
element. While this height might be good for the mobile layout, it's forcing your card to extend higher than needed for the desktop version.So, in your
(min-width: 80em)
media query for.card
, you can writemin-height: initial
ormin-height: 0
to reset it. That should take out the dead space!1 - @GeorgenicoPosted over 1 year ago
Hi there, congratulation on finishing this project.
I tried to examine your code and I think the little weird dead space you're talking about is coming from the minimum height. I suggest that you remove that from the parent container.
.card { min-height: 80vh }
Just remove that and I think you are fine now.
0 - @0xabdulkhaliqPosted over 1 year ago
Hello there 👋. Congratulations on successfully completing the challenge! 🎉
- I have other recommendations regarding your code that I believe will be of great interest to you.
MIN-HEIGHT 📐:
- Use
min-height: 100vh
formain
instead ofheight: 98vh
. Setting theheight: 98vh
may result in the component being cut off on smaller screens.
- For example; if we set
height: 98vh
then themain
will have98vh
height no matter what. Even if the content spans more than98vh
.
- But if we set
min-height: 100vh
then themain
will start at100vh
, if the content pushes themain
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!
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