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
Edit the page where you want to hide the left navigation bar.
Add a Script Editor web part to the desired zone on the page.
Edit the web part and click on the "Edit Snippet" or "Edit Code" button.
Paste the provided code into the code editor of the web part.
Click "Apply" or "OK" to save the changes.
Publish the page.
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.
Comentários