css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv
CodePen probably won't work great in this browser. We generally only support the major desktop browsers like Chrome, Firefox, Safari, and Edge. Use this one at your own risk! If you're looking to test things, try looking at Pens/Projects in Debug View.
user profile image

Hamburger menu open/close toggle animation with some CSS3.

Toggle is done without Javascript. Instead we're using a checkbox to utilize the :checked selector and doing the toggling with a label that has attribute "for," which directly corresponds to the checkbox with the same id value. The label, when clicked, toggles the checkbox.

We're also utilizing the adjacent sibling selector, +, to do styling for when the checkbox is checked.


  1. Hi Jonathan, how could I get a defined background to expand to the right 300px when checked?

  2. Sweet animation! Clever code.

Leave a Comment Markdown supported. Click @usernames to add to comment.

You must be logged in to comment.