[Support request] CSS to set the width of dropdown menus to fit the widest menu item not working

Home Forums Support [Support request] CSS to set the width of dropdown menus to fit the widest menu item not working

Home Forums Support CSS to set the width of dropdown menus to fit the widest menu item not working

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2143498
    Andrew

    Hello,

    I’m trying to set the width of dropdown menus to fit the widest menu item (desktop only).

    I tried using this CSS but it’s not working. I’m not sure if I have other CSS that might be conflicting with it.

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

    #2143561
    David
    Staff
    Customer Support

    Hi there,

    try giving it some importance:

    @media(min-width: 1025px) {
        .main-navigation ul ul {
            width: auto !important;
            white-space: nowrap;
        }
    }

    And the media query is to stop it. messing up on mobile

    #2143572
    Andrew

    Hi David – Thank you. That worked but I noticed on tablet the drop-down menu is now shifted to the left when I click on the menu items.

    #2143573
    David
    Staff
    Customer Support
    #2143593
    Andrew

    Perfect, thank you!!

    #2143609
    David
    Staff
    Customer Support

    You’re welcome

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.