Design comparison
SolutionDesign
Solution retrospective
can someone please teach me how to add the background tint for active mobile Navbar please thanks
Community feedback
- @DaveMan-stackPosted almost 2 years ago
- the mobile menu icon shows on top of everything when I scroll even down to the page
- try making it fixed or relative to the nav element and not to the body element.
- also change the background color when the menu is open for mobile
- You can do that easily by adding a class to the body say activated when the menu button is clicked. Then select that class and give it the appropriate background color.
Marked as helpful0 - @for-dev9Posted almost 2 years ago
- add modal div --> <div id="modal" class="modal"></div>
- set modal stylesheet --> display: none; position: fixed; z-index: 1; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5);
- update your menu stylesheet --> z-index:2
- Call JS function to show modal div -- > document.getElementById('modal').style.display = 'block';
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