top of page
Writer's pictureSubir Hazra

Hiding SharePoint Left Navigation Bar with Script/Content Editor Web Part: Code Implementation

Below is an example of code that can be used in a Script Editor/Content Editor web part to hide the SharePoint left navigation bar,


<style>
#sideNavBox {
    display: none !important;
}
#contentBox {
    margin-left: 0px !important;
}
</style>

To implement this code


  1. Edit the page where you want to hide the left navigation bar.

  2. Add a Script Editor web part to the desired zone on the page.

  3. Edit the web part and click on the "Edit Snippet" or "Edit Code" button.

  4. Paste the provided code into the code editor of the web part.

  5. Click "Apply" or "OK" to save the changes.

  6. Publish the page.


SharePoint homepage left navbar
SharePoint homepage left navbar

This code uses CSS styles to hide the left navigation bar by setting its display property to "none". It also adjusts the margin of the content area to occupy the entire space.

Please note that the Script Editor web part may not be available in modern SharePoint experiences. In such cases, you can consider using other methods like adding custom CSS through a SharePoint Framework (SPFx) Extension or applying CSS using Power Automate to achieve the desired effect.


21 views0 comments

Comentários


Disclaimer

Welcome to my professional blog! The articles shared here are based on my personal experiences and knowledge, intended to serve as a valuable reference for myself and to assist readers like you.

 

Kindly refrain from reproducing my content in any manner without obtaining my explicit permission. In the event that any article infringes upon copyright regulations, please don't hesitate to reach out to me. I appreciate your input and encourage you to share your insights or alternative solutions by leaving a comment. Your valuable contributions are highly appreciated!

Copyright © 2023 by SHAREPOINT INSIGHTS. All rights reserved.

bottom of page