Skip to content

Instantly share code, notes, and snippets.

@jamesnotjim
Last active December 1, 2016 22:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesnotjim/22dc60a3b8618ce74933bd7f12ad4ad2 to your computer and use it in GitHub Desktop.
Save jamesnotjim/22dc60a3b8618ce74933bd7f12ad4ad2 to your computer and use it in GitHub Desktop.
Hides the Quick Launch on a SharePoint 2013 or O365 Team Site or Blog site
<style type="text/css">
#sideNavBox {
display: none;
}
#contentBox {
margin-left: 36px;
margin-right: 36px;
}
.ms-fullscreenmode #contentBox
{
margin-left: 0px;
}
div.welcome-content {
display: none;
}
</style>
@jamesnotjim
Copy link
Author

jamesnotjim commented Aug 4, 2016

Hide Quick Launch

A bit of CSS to hide the Quick Launch (i.e. left navigation menu) on SharePoint 2013 and O365 sites. Just add a Script Editor Web Part to any zone of your page and insert this code. For convenience, I tend to rename the Script Editor Web Part "CSS."

Scope

Works for Team Sites and Blog sites on SharePoint 2013 and O365. Works on Publishing Sites that use the "Blank Web Part page layout." May work on others as well. Probably works on any layout with zone to which you can add Web Parts.

Customization

Adjust the #contentBox margin-left attribute (set to 0px, in the example) to add left margin, if your content ends up being too close to the left edge of the screen.

Recent Changes

Added a display:none for div.welcome-content, which takes up space across the top of some pages (between the SharePoint logo and the first Web Part zone). If you use .welcome-content in your designs, you'll need to remove that bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment