Design comparison
Solution retrospective
Corrections are allowed
Community feedback
- @elaineleungPosted over 2 years ago
Hi Oyindamola, great job here working on this :) Here are some suggestions that you can try:
First, I see that you used a 100px top and bottom margin, probably to space things out. It's always best to try to use grid or flexbox first for position, and in your case it looks like you want some extra space around the component. You can try centering the component instead by writing this in your body selector:
body { display: grid; place-content: center; min-height: 100vh; }
I also suggest putting the main font color on the body here since it looks like you haven't used it yet.
If you try the above in the body, you'll find that your overlay will have shifted. For the overlay, since you got a
position: absolute
on it, you should ideally have aposition: relative
on the parent container, which in this case is.card
div. Otherwise, the browser would go to the topmost element, which is usually the body if nothing else hasposition: relative
. After setting theposition: relative
on.card
, change thetop
to 20px instead, since that's the width of your card padding.Hope these suggestions help you out a bit!
Marked as helpful0
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