No Word Wrap in Submenus

This prevents your submenu items from breaking into multiple lines.

By default, the dropdown menu in the primary navigation will wrap words onto multiple lines if they are too long, like this:

Default

To prevent this from happening you can use the snippet of CSS provided below to set a minimum width on the dropdown menu, and set the items to “nowrap” which will keep them on one line, like this:

No wrap

Paste the following CSS into your site’s child theme or wherever you add CSS to prevent the items in your submenu from wrapping:

.main-navigation ul ul {
  width: auto;
  min-width: 200px;  
  white-space: nowrap;
}

Kyle Van Deusen

Co-founder of The Admin Bar Community, owner of OGAL Web Design, and a GeneratePress & GenerateBlocks enthusiast.

For official support, please visit the forums for GeneratePress or GenerateBlocks

If you're looking to have a website built with GeneratePress & GenerateBlocks, then visit my agency website.

Leave a Comment