skip to Main Content

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

Responsive view for position:absolute – Html

I am having a background image on top of that need to place sub images which will look like connection to a circuit. Current Result: .container { background-image: url('https://i.stack.imgur.com/AfygH.png'); height: 400px; background-position: center; background-size: stretch; background-repeat: no-repeat; } .coil {…

VIEW QUESTION

Line breaker with CSS – Html

I have a checkbox in my form. Here is the code: input[type="checkbox"] { transform: scale(1.3); text-align: center; padding: 5px; display: inline; } div.checkbox label { display: inline; /* margin-left: .5rem; */ <div class="checkbox"> <h2>Choose your favorites programming languages (optional)</h2> <input…

VIEW QUESTION
Back To Top
Search