Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Responsive site using mobile first approach

@augustine-a8

Desktop design screenshot for the Intro section with dropdown navigation coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


How to implement the background overlay when the mobile nav bar is open

Community feedback

Josh 320

@Ao-chi

Posted

Hi Augustine!

Just some tips on the overlay. To solve this you can add another <div> element and give it a class of "overlay" or whatever name you'd like. 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;
}

You can toggle the active class with javascript every time you open the nav on mobile. Hope this makes sense and wish I could help! Happy coding~

Marked as helpful

0

@Youssef1khalil

Posted

@Ao-chi I made it with the box shadow but the way you wrote is good also

0
Josh 320

@Ao-chi

Posted

@Youssef1khalil Nice! that's pretty neat way to do it too

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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