skip to Main Content

Hamburger menu in navbar not working using html and css

*{ padding:0; margin:0; } a{ text-decoration:none; color:black; } ul{ list-style:none; } /* Uppermost bar */ #upper_bar{ min-height:10vh; max-width:100vw; background-image: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%); /* background-color: rgba(0,0,0,0.3); */ color:black; display:flex; justify-content: center; align-items: center; font-size:2vw; } /* Header */ header{…

VIEW QUESTION

React beginner. My NavBar gives error of "Uncaught TypeError: Cannot read properties of null (reading 'addEventListener') i cant seem to tell why." – Reactjs

I try to create and use an animated hamburger menu icon instead of already made icons for my Navbar component `const menu = document.querySelector('.menu_button'); const showMenu = document.querySelector('.mobile-nav'); let menuOpen = false; console.log(menu); menu.addEventListener('click', () => { if(!menuOpen){ menu.classList.add('close'); showMenu.classList.add('open');…

VIEW QUESTION
Back To Top
Search