Dropdown menu text breaking into two lines – need wider menu box

Dropdown menu text breaking into two lines – need wider menu box

BenjaminW
Visitor
3 0 1

Hi Shopify Community 🙌

 

I’m working on a customized version of the Dawn theme and have a dropdown menu in the header titled “Hjælp” (Help).

 

One of the submenu links – “Ofte stillede spørgsmål” (Frequently Asked Questions) – is breaking into two lines because the dropdown menu box isn’t wide enough. I want the entire link to stay on one line.

 

Here’s what I’ve tried (without success): 

#HeaderMenu-MenuList-2 {

  white-space: nowrap;

  width: auto;

}

 

I also tried adjusting padding, min-width, and max-width, but the dropdown still doesn’t expand to fit the full text.

 

The correct element has the ID #HeaderMenu-MenuList-2, confirmed via DevTools. I’ve added the code to base.css and verified it’s saving properly.

 

How can I make the dropdown menu automatically expand to fit the longest link so nothing breaks onto two lines?

 

Thanks in advance 🙏

– Benjamin

Replies 4 (4)

Jack_Khan_Baba
Shopify Partner
131 9 17

share your store link 

 

Please don't forget to Like and Mark Solution to the post that helped you. Thanks!
Chat on WhatsApp: +923143054166
Need a Shopify developer? Hire us at naimatullahts335@gmail.com
- Hire me, if you want to design, re-design, develop a store, or make changes to the pre-built store.
BenjaminW
Visitor
3 0 1
Dan-From-Ryviu
Shopify Partner
11742 2303 2487

Hi @BenjaminW 

Please add this code to Cutom CSS in Online Store > Themes > Customize > Theme settings.

details[open] > .header__submenu {
    width: max-content;
}

Screenshot 2025-04-23 at 09.52.14.png 

- Helpful? Like & Accept solution! - Support me? Buy me a coffee
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...
Sign up now.

namphan
Shopify Partner
2690 349 396

Hi @BenjaminW,

Please go to Actions > Edit code > Assets > component-list-menu.css file and paste this at the bottom of the file:

.list-menu--disclosure {
    width: 22rem;
}
Coffee tips fuels my dedication.
Shopify Development Service
PageFly Page Builder Optimize your Shopify store (Free plan available)
Need help with your store? namphan992@gmail.com