Dynamic breakpoint oxygen builder menu element
Add a dynamic breakpoint to your horizontal navigation menu in Oxygen Builder — a simple CSS flexbox fix that wraps menu items on mobile devices.
27 April 2024 · Moritz Reitz
This article explains why the oxygen menu items does not wrap it's children into a new row when they are overflowing the screen. To understand this article you will require a basic understanding on flex-box. You can watch this video by Kevin Powell or read about flexbox on the MDN Docs.
The 'issue' with the native menu in oxygen
The Oxygen menu's ol element is set up as a flex-box, but does not contain a 'flex-wrap:wrap', which allows flex elements that would horizontally overflow
- Create a stylesheet in Oxygen Builder
/*Target ul selector of the relevant menu class swap .menu--footer for relevant menu class or #selector*/
.menu--footer ul {
flex-wrap:wrap;
}
/*Target li selector withing the list targeted above swap .menu--footer for relevant menu class or #selector*/
.menu--footer ul li{
width: fit-content !important;
}- Apply the class '.menu--footer' to your menu element in the Oxygen editor
Add this code to your style sheet:

This is a quick CSS-only fix that doesn't require any JavaScript or Oxygen Builder settings change. The same flexbox wrapping principle applies if you're building menus in other page builders. If you're also dealing with plugin stylesheet conflicts, my post on removing plugin stylesheets in WordPress covers how to cleanly dequeue unwanted CSS. For help with WordPress website builds and custom front-end development, take a look at my WordPress development services.
FAQ
Why don't Oxygen Builder menu items wrap to a new row on smaller screens?
Oxygen's native menu uses a flexbox `- ` element but doesn't include `flex-wrap: wrap` by default. Without it, flex items can't overflow onto a new line — they'll either clip off-screen or get compressed. Adding `flex-wrap: wrap` to the `ul` selector and `width: fit-content !important` to the `li` selector fixes this with pure CSS and no JavaScript required.