Share via

Quick Launch Drop Down Autofit

CM Terry 1 Reputation point
2022-05-25T15:07:51.85+00:00

Let me apologize first. Our company just changed from Sharepoint Online to 2016. We lost our departments site and I've been tasked with building a new one. I have no experience in Sharepoint so I am researching everything. I've exhausted my search on this topic outside. My problem is that,, in my quick launch bar to autofit to stop the word wrapping inside the box itself. I need the link drop down box to autofit to the longest link in the box. Can anyone, at least, point me in the right direction to get this accomplished?

Microsoft 365 and Office | SharePoint Server | For business

1 answer

Sort by: Most helpful
  1. Yanli Jiang - MSFT 31,691 Reputation points Microsoft External Staff
    2022-05-27T10:44:14.55+00:00

    Hi @CM Terry ,
    According to my research and testing, you can only change the width manually with the CSS but not able to make the width autofit by the text.
    Change a particular page:
    Open the page where you want to change the quick launch, Edit page and then from the ribbon click on Add web part and from Media and Content and then select Script Editor web part.
    Then copy the following CSS to the web part.

    <style>  
    #sideNavBox{width: 500px !important;}  
    #contentBox { margin-left: 540px }  
    </style>  
    

    NOTE: The value of width must be at least 40px smaller than the value of contentBox.

    And then, you can see the width of quick launch has been changed.

    If you want to change the width of quick launch of whole site, you can add it to master page.

    Thanks,
    Yanli Jiang

    ===========================================

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.