Programming Exercises

Implement a CSS-only hamburger menu that toggles on click.

Hard

Problem Statement

Implement a CSS-only hamburger menu that toggles on click.

Sample Output

Clicking the hamburger icon toggles the menu.

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
<!DOCTYPE html> <html> <head> <style> /* Add CSS here to create the CSS-only hamburger menu */ </style> </head> <body> <div class="hamburger-menu"> <input type="checkbox" id="toggle" /> <label for="toggle">&#9776; Menu</label> <div class="menu"> <ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> </div> </div> </body> </html>
Log in or sign up to run or submit your code.Log inSign up
Expected Output
Clicking the hamburger icon toggles the menu.