Topic: Drop down menu - expand width to fit content

Yiannis Kyriazidis free asked 2 years ago

Im using the drop down menu but the custom content is beeing wrapped to the width of the container dropdown-menu. How do you make it so the drop down menu width is automatically adjusted to fit the child content so that it doesnt get wrapped into multiple lines.

see example

Michał Duszak staff answered 2 years ago

Use CSS to modify dropdown-menu container, for example:

.dropdown-menu {
  width: max-content;

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: MDB5 3.10.2
  • Device: windows desktop
  • Browser: chrome
  • OS: windows
  • Provided sample code: No
  • Provided link: Yes