Responsive Menu With Media Queries (Checkbox Trick) - Using Only CSS3
Why Stack Overflow recommends it
Stack Overflow users cite it as the source of their pure HTML and CSS hamburger menu, and then ask for help when the checkbox-toggle approach breaks in their own code.
Recommended by 2 people across 2 different months, 2018 to 2020.
What it is
A short code tutorial by Caler Edwards showing how to turn a normal navigation bar into a mobile hamburger menu using CSS media queries. It uses the checkbox hack to open and close the menu with no JavaScript or jQuery.
What people said
Recommends Azazel · 2019-01 · Stack Overflow · on “CSS Toggle not floating on right side”
Okay, so I am trying to make a responsive navigation menu for my website. I am currently having trouble making this dang float property work. So I've taken a combination of [LINK] and a YouTube tutorial to make a website that I envision. Here is what I got so far ( Link to my code is below in hyperlink to JS Fiddle ) [LINK] So if you actually look in the label attribute under the media and screen section where the max-width begins for pixels. Take a look at this part of my CSS. label { display: block; cursor: pointer; /* float: right; */ } My goal is to make my top nav bar menu to appear beneath the hamburger icon when in mobile/tablet form. When in desktop mode, my menu list is on the left
Recommends gx0st · 2019-04 · Stack Overflow · on “Image overlapping Burger Navigation Menu made with CSS and HTML”
I am having an issue with this new website for my local Church. I followed this tutorial to create a burger menu with just HTML and CSS: [this video] Now after learning how to do it, the issue I am running into is I am trying to put an image in the body under the navigation menus, however, when I make my web resolution smaller and click on the burger menu. It is under the image. I appreciate any help, I tried to look for it everywhere, or I tried at least. I am new to coding. So thank you for your time spent helping me. I really do appreciate it. **HTML** <!DOCTYPE html> <html> <head> <title>Church of Christ</title> <link rel="stylesheet" type="text/css" href="main.css"> <meta charset="utf-8"> <m
Cites Hide · 2018-05 · Stack Overflow · on “Navbar hamburger menu with checkbox doesn't work”
Now I making a header navbar with only HTML+CSS. (No Javascript) Refer to this video -> [this video] , At 9:46, He uses checkbox to make hambuger menu that work likes using js. While I following his video, It doens't work properly. [index.html] <html> <head> <title>Apple</title> <link rel="stylesheet" href=" [LINK] " integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous"> <link rel="stylesheet" type="text/css" href="style2.css"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <nav> <div class="menu-mobile"> <a href="#"><i class="fab fa-apple"></i></a> <label for="toggle">☰</label> <input type="checkbo
Cites xDestino · 2018-08 · Stack Overflow · on “HTML | CSS: Issues with hamburger menu”
My name is Troy, I have been trying to create a Hamburger menu for ages now on HTML and CSS. I found a tutorial on YouTube, and it worked fine, till I added <nav></nav> below it. I will include the link to the youtube video here [this video] . So basically the issue is that I tried adding a <nav></nav> under the header, and then when I click on the hamburger menu, It destroys the entire thing, until I close the hamburger menu again: There are loads of comments on the video saying that I should add a min-height: 70px; in the CSS. Tried it, but it did not do anything. I appreciate the reader who is reading this to spend time trying to find a way how to help me <3 Also, here you have my code of HTML
Cites Dars Devs · 2019-02 · Stack Overflow · on “Hamburger for navigation bar in CSS issue”
I am working on my own website and currently having an issue with a toggle button. When I click on the hamburger menu, the navigation bar doesn't show up. But the toggle bar is working. I just do the same thing but I just combined the two sources since the concept is the same. Source codes: [this video] [LINK] * { margin: 0; padding: 0; } #toggle { display: none; } .hambuger { z-index: 1; /*keeps displaying the icon when it clicks*/ position: fixed; width: 25px; /*The parents (hamburger) of siblings (span)*/ top: 20px; left: 28px; cursor: pointer; /*to able to click it*/ } .line { display: block; /*to show the three lines*/ width: 100%; /*Maximize the width of the parents (hamburger: 25px width)*
Cites Parth Chauhan · 2019-04 · Stack Overflow · on “Why my hamburger menu using checkbox not working?”
I am trying to make a hamburger menu using HTML and CSS only. I tried it from [this video] . Now I don't know why my code is not working. header{ background-color: #f1f1f1; text-align: center; } .inline{ display: flex; justify-content: space-around; align-items: center; } header .primary #toggle{ display: none; } header .primary #toggle:checked ~ header .primary nav{ display: block; } header .primary label{ font-size: 2.25rem; display: block; cursor: pointer; } header .primary nav{ display: none; } header nav ul{ font-size: 1.25rem; } header .primary nav ul li{ padding: 1rem; } header nav ul li a{ text-decoration: none; color: #000000; } header nav ul li.active{ border-bottom: 2px solid black; ma
Cites James Baird · 2020-05 · Stack Overflow · on “remove mobile menu when list item is clicked”
This is my first question so apologies if not following standard practice. I need help with this mobile nav menu. I got the code of the below youtube video. The issue is, while it is a good attempt at a pure CSS mobile nav, the menu does not auto remove when a list item is clicked. .nav { opacity: 1; position: fixed; z-index: 999; border-bottom: 1px solid #EAEAEB; text-align: right; height: 70px; line-height: 70px; width: 100%; background: rgb(66,65,65); background: grey; transition: all 1s ease; } .menu { margin: 0 30px 0 0; } .menu a { clear: right; text-decoration: none; color: #fff; margin: 0 10px; line-height: 70px; font-size: 2em; transition: all 0.5s ease; } label { margin: 0 40px 0 0