Skip to content

Design5 min read

How to Create an Animated Burger Menu in Webflow

Learn how to create an animated burger menu in Webflow, turning the hamburger into a close icon, without plugins, using CSS transitions and JavaScript.

In this tutorial, Sandro, cofounder of Gemeos Webflow agency, shows you how to create an animated burger menu (hamburger → cross) in Webflow without a plugin.

Example

LineCSS classClick transformation
Line 1burger-line-145° rotation and translation
Line 2burger-line-2Opacity 0 (disappears)
Line 3burger-line-3-45° rotation and translation

1. Create the burger button

Create a Div burger-btn containing 3 Divs: burger-line-1, burger-line-2, burger-line-3. Each line: width 24px, height 2px, background in your color, margin-bottom 5px. Add cursor: pointer to the container.

2. Add the transition CSS

.burger-line-1, .burger-line-2, .burger-line-3 {
  transition: all 0.3s ease;
}
.burger-btn.open .burger-line-1 {
  transform: rotate(45deg) translate(5px, 5px);
}
.burger-btn.open .burger-line-2 {
  opacity: 0;
}
.burger-btn.open .burger-line-3 {
  transform: rotate(-45deg) translate(5px, -5px);
}

3. Add the toggle script

const burger = document.querySelector('.burger-btn');
const nav = document.querySelector('.mobile-nav');
burger.addEventListener('click', function() {
  burger.classList.toggle('open');
  nav.style.display = nav.style.display === 'flex' ? 'none' : 'flex';
});

Conclusion

An animated burger menu improves the mobile experience. Use cases:

  • Custom mobile navigation
  • Sidebar or drawer menu
  • Full-screen overlay menus

Published on May 19, 2026

Sandro DA SILVA

Growth Marketer, Webflow expert, and jack-of-all-trades. Sandro handles commercial operations, ensures projects run smoothly, and addresses marketing-related issues (SEO, Tracking, Copywriting, etc).

You're going to working with us, guaranteed

Ready to launch your business?

get a quote

Let’s f*****G GO !!