Title: Submenu Width
Last modified: May 27, 2020

---

# Submenu Width

 *  [anti78](https://wordpress.org/support/users/anti78/)
 * (@anti78)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/submenu-width-3/)
 * Hello. The theme’s great. But I have a question about the submenu. As you can
   see in the picture, some menu items are wrapped. Can I change the width of the
   submenu? To make it fit the longest menu item?
 * [Image Submenu](https://s12.directupload.net/images/200527/tklmtp7c.jpg)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Theme Author [Ben Sibley](https://wordpress.org/support/users/bensibley/)
 * (@bensibley)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/submenu-width-3/#post-12900305)
 * Thanks for using Tracks!
 * Please add this CSS to your site and let me know what you think:
 *     ```
       .menu-primary ul ul li {
         white-space: nowrap;
       }
       .menu-primary ul ul {
         max-width: none;
         left: -100%;
         right: -100%;
       }
       ```
   
 * You can copy & paste the code above into the “Additional CSS” section in the 
   Customizer (Appearance > Customize), and it will take effect right away.
 *  Thread Starter [anti78](https://wordpress.org/support/users/anti78/)
 * (@anti78)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/submenu-width-3/#post-12904290)
 * Hello, Ben. Thanks for your answer. Unfortunately, it’s not really working yet.
   
   The first submenu is getting wider. But one entry is too wide. And the other 
   submenus are way too wide.
 * See pictures.
 * [Submenu 2](https://s12.directupload.net/images/user/200528/egpssag4.jpg)
 * [Submenu 3](https://s12.directupload.net/images/user/200528/seofe4qm.jpg)
    -  This reply was modified 5 years, 11 months ago by [anti78](https://wordpress.org/support/users/anti78/).
 *  Theme Author [Ben Sibley](https://wordpress.org/support/users/bensibley/)
 * (@bensibley)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/submenu-width-3/#post-12905498)
 * Got it. Try swapping out the previous code for this CSS instead:
 *     ```
       .menu-primary ul ul li {
       	white-space: nowrap;
       }
       .menu-primary ul ul {
       	max-width: none;
       	width: auto;
       	left: 50%;
       	right: auto;
       	transform: translateX(-50%) !important;
       }
       ```
   
 *  Thread Starter [anti78](https://wordpress.org/support/users/anti78/)
 * (@anti78)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/submenu-width-3/#post-12924883)
 * It’s working great. Thanks for your help.
 *  Theme Author [Ben Sibley](https://wordpress.org/support/users/bensibley/)
 * (@bensibley)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/submenu-width-3/#post-12927322)
 * Happy to help 🙂

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Submenu Width’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/tracks/1.81/screenshot.png)
 * Tracks
 * [Support Threads](https://wordpress.org/support/theme/tracks/)
 * [Active Topics](https://wordpress.org/support/theme/tracks/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/tracks/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/tracks/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Ben Sibley](https://wordpress.org/support/users/bensibley/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/submenu-width-3/#post-12927322)
 * Status: not resolved