Skip to main content

How To: Hide Left Side Navigation on Home Page

I was recently asked: "How can I hide the side nav bar on the main homepage layout ?? I want to be able to use the side NAV with in the team site etc etc, but I don't want it on the front page.. "

There are a couple of ways to do this in SharePoint 2010. If you are using a non-publishing site you can add a Content Editor Web Part to the page and add the following to the HTML Source.

body #s4-leftpanel
display: none;
margin-left: 0px;

Basically the CSS above hides the left navigation Div, and then sets the content area to not have a left margin.

Once you are done, simply modify the web part and hide it on the page.


If you are using a publishing site for your homepage simply add the same styles specified above to a custom page layout. That way if you have a need for other pages that do not need the left side navigation you can re-use the page layout.


Dan said…
Awesome... thank you ...
Christian Stahl said…
Hi mate! I was struggeling with this for some month ago, and get to the same result as you, I wrote about that in my blog.
Mahmoud Aleryan said…
Nice article.
Do u know how to fix the height of the content div?
that the top and left navigation bars have a fixed position when the user scrolls the page down or up?

Thanks in advance for your help.
Anonymous said…
Good Post,
I am trying to reverse a bit by showing top global nav and left nav for a site/site collection created with Publishing Team Site Template. I need to show both, but if i create a web part page i am getting top nav ONLY, and if i create a Publishing page i am getting ONLY Left nav, I think it's because of master pages one uses v4.master other one uses nightandday master, anyway i can add something in nightandday master page to show top nav.

Appreciate your help - Ipacs
Anonymous said…
You are my saver for today!!
Anonymous said…
For me it didn't work, I was able to do it in different way
Anonymous said…
This is about the tenth or so post i've found on the subject, but none specifies where the "master file" is; not even a file name! Could you please be more specific?
Anonymous said…
thank you for the post
Niranjan said…
thanks for the tip.
can u suggest how to hide quick launch on application pages? i tried adding your css class to my custom master page.i can hide quick launch on settings.aspx but not on user.aspx page
any help will be appreciated
Kim said…
This is so great! Thanks for posting - I tried to do this for 3 days before!
Balu said…
Thank you! It works like a charm!
Unknown said…
This comment has been removed by the author.
Unknown said…
This comment has been removed by the author.
Unknown said…
This comment has been removed by the author.
Unknown said…
Could i this trick use in Security Trim controls, actualy want to close this panel for users who hase the view permissions, could I?
Anurag said…
very good post thanks a lot...
Anonymous said…
I have Tried Hiding Recently Modified section in the Left Navigation in “Site Pages” using below CSS in HTML Form Web Part
< style type="text/css">
{display: none;}
< /style>
It is hidden for Users, who have “Full Control” permission, but not for others. I have “Full Control” Permissions.
Please provide any solution for this issue.
Unknown said…
Worked perfectly. Thank you!
aterese said…
Erik, I've been trying to find a way to turn the left navigation into a dropdown menu in my responsive design (after the global navigation dropdown). Do you have any articles on this, as I can easily accomplish on the global nav, but no the quick launch.
Karl said…
Hi thanks a lot for the contribution i tried and works very find in Sharepoint 2010.

I was concerned with the wandering of the users in the left hand menu, but with this i applied not to a Home page else a List page and works like a charmy.Thanks again!
Russ said…
Works very well, thanks. Question, from a layman: how about the right panel???
Unknown said…
THank you!!!!!!!!!!!!!!!!!!!!!!

Popular posts from this blog

SharePoint 2010 Base CSS Classes

This will be the first of many SharePoint 2010 posts. I will be focusing on a few of the main CSS classes used for SharePoint 2010 Public Beta. As the product becomes more final there might be some changes to the class names but I will be sure to create a new post if that happens. This will be quite a lengthy but it should be helpful. The default CSS given below are just highlights of the full CSS attributes for that class. I will be using a basic team site as my base for the screenshots. Here is a basic structure of the main areas that I will cover. Ribbon Row Table Row Left Site Actions Navigate Up Edit Tab List Browse Page Table Row Right Give Feedback Welcome Menu Workspace Body Container Title Row Title

How To: Create Hyperlink to Modal Pop-Up Form

I was asked by a client recently if there was a way to create a hyperlink to a New Item Form anywhere within a site but still get the rich experience of the Modal pop-up window that grays out the background. (Note this is for SharePoint 2010 Only…) I basically took the code directly from the “Add new item” and the “Add Document” link within the list view. What this allows you to do is simply add in the following code to any content editor web part, Master page, or Page Layout in any site collection and display the form to be filled out. The user will get the nice experience of the modal window and not have to navigate away from their current page. This could be used for example a feedback form that is included in the master page so whenever someone wants to give feedback it is always going back to a central list. The only that is required for you to know is the List ID and the site name. Full Code For a List Item: <a onclick="javascript:NewItem2(event, &quot

SharePoint 2010 Content Query for Blog Posts

I hope this post will help many of you feel comfortable with using the Content Query Web Part. In this post I will walk you through the process of creating a content query web part and configuring it to show custom field types. I will also give details on how to use XSLT to stylize and format the data being pulled. I will be using the following scenario as an example. Say that you had a site collection with a top level publishing site. This publishing site would display a the most recent blog posts from all blog sites within its own site collection. To solve this problem we will use a Content Query Web Part and a customized ItemStyle.xsl using XSLT. Please note that the “SharePoint Server Publishing Infrastructure” needs to be enabled at the site collection to display the content query web part. Step 1: Add a Content Query Web Part to Page Navigate to the site that you want the blog posts to show up and click on edit page. Under Editing Tools in the Ribbon, Click on