Search code examples
wordpressheadercustomizationelementor

Adding break line in the sub menu when the label is too long


I'm struggling in my submenu using WordPress. I'm currently using a Customize Header in my Project and I want to add some breakline(br) in the label of my submenu. So Here's my Problem Image of my Sub-menu

As You can, the sub-menu stretches all away along, and I want to Compress it. example If the anchor label is too long the submenu must break the text using some BR to align base on size of the width that is set. my code is here.

.sub-menu>.menu-item>a>.elementor-sub-item{
    width:150px;
    font-size:10px
}

The width of the sub menu shrink base on the width that I set, but the content doesn't fit at all This is the output.

This is the output


Solution

  • I guess you have white-space: nowrap, so try to add

    .sub-menu>.menu-item>a>.elementor-sub-item{
      white-space: normal;
    }
    

    to links.
    And pls attach link to site - without that it's hard to understand what css you have and where is problem.