Design comparison
Solution retrospective
I found trying to make the page properly responsive really difficult although the end-product is OK. I built it mobile-first and whenever I go from mobile to desktop, the navigation moves outside the page. Haven't found a good way to deal with it yet and it's due to the buttons I used for the mobile navigation. Also, the overlay that happens when the mobile navigation is on screen is weird, the rest of the background darkens but images and buttons remain bright. I haven't figured out a way to fix it, it's the first time I've ever tried javascript. If you have any advice of feedback, I'd be happy to here them!
Community feedback
- @Ao-chiPosted almost 2 years ago
Hi Francine, Congrats on finishing the challenge.
Just some tips on the overlay. I found that you are only changing the body's background color that is why it looks like the images and other text are on top of it. To solve this you can add another <div> element and give it a class of "overlay" something like this:
<div class="overlay"></div>
and style it on css with this:
.overlay { display: block; position: fixed; top: 0; right: 0; left: 0; bottom: 0; background-color: rgba(4, 2, 15, 0.6); visibility: hidden; opacity: 0; z-index: 1; } .overlay.active { visibility: visible; opacity: 1; } @media (min-width: 992px) { .overlay.active { visibility: hidden; opacity: 0; } }
You can toggle it with javascript every time you open the nav on mobile. Hope this helps! Happy coding~
Marked as helpful2
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