Ajouter

Lorem ipsum

Lorem ipsum

Design

4 views

6 min

How to Create a Mega Menu in Webflow

Learn how to build a mega menu in Webflow without plugins, using native interactions and CSS.

In this tutorial, Sandro, cofounder of the Gemeos Webflow agency, shows you how to build a mega menu in Webflow without a plugin, using only native interactions and CSS.

Example

Design

Development

ElementCSS classRole
Parent nav itemnav-itemTrigger element for the mega menu
Mega menu containermega-menuThe panel that opens
Inner columnsmega-menu-colColumns for links or content

1. Create the mega menu structure

In your Navbar, add a Div with the class nav-item containing the trigger link. Inside it, add a second Div with the class mega-menu, which will be the panel. Set mega-menu to display: none by default. Position it absolute relative to the nav-item (relative).

2. Organize the content into columns

Inside the mega-menu, create several Divs with the class mega-menu-col and set them to display: flex. Add your links, category titles, and optionally images or icons.

3. Add Webflow interactions

On the nav-item element, create an interaction:

  • Trigger: Mouse over (Hover in)
  • Action: Display mega-menu → block or flex
  • Hover out: Display mega-menu → none with a 200ms delay

4. Handle closing when hovering over the mega menu

Add the same "Mouse over" interaction to the mega-menu itself so it doesn't close when the mouse moves from the item to the panel. Hover out on the mega-menu: display none.

5. Close the mega menu when clicking outside

Add this script in the <body> to close the mega menu if the user clicks anywhere else on the page.

// Close the mega menu if you click outside
document.addEventListener('click', function(e) {
document.querySelectorAll('.mega-menu').forEach(function(menu) {
if (!menu.closest('.nav-item').contains(e.target)) {
menu.style.display = 'none';
}
});
});

good to know

The 200ms delay on Hover out is crucial: without it, the mega menu closes before the mouse reaches the panel. For a smoother result, use a CSS opacity/transform transition rather than display none/block: the mega menu stays in the flow but becomes invisible, which avoids layout jumps.

Conclusion

The mega menu improves navigation on sites with lots of pages. Use cases:

  • Ecommerce sites with multiple product categories
  • Corporate sites with many sections
  • SaaS with multiple products or features

Published on

You might be interested in these tutorials

Similar tutorials

SEO / GEO

5 min read

5 views

How to Set Up a Redirect in Webflow? (2026)

Updated on 19.12.2025 by Sandro DA SILVA

SEO / GEO

5 min read

5 views

Add structured data to your Webflow site?

Updated on 21.08.2025 by Sandro DA SILVA

No-code

5 min read

5 views

How to Obfuscate a Link in Webflow

Updated on 23.04.2025 by Sandro DA SILVA

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

Ready to launch
Your business?

Alexandre

Max

Enora

Bryan

Cannelle

Tiphaine

You'll :heart: our collaboration...