Skip to main content

Hide First Tab in SharePoint 2010 Navigation

I created a blog post on this for SharePoint 2007 HERE: But SharePoint 2010 is a bit more complex. Since it uses UL’s and Li’s for it’s navigation it is a bit harder to hide just one element.


You will notice that the Home tab actually is the first node and then has a child UL which represents the rest of the navigation Items. So the approach is to hide the first <li> <a> (display: none) and then simply just use (display:block ) to show the hidden <ul> <li> <a> tags.

Here is the CSS you could use to hide just the first node (home) tab in a SharePoint 2010 application:

.s4-tn li.static > a{
display: none !important;
.s4-tn li.static > ul a{
display: block !important;




Taylor Pilewski said…
I'm having a hard time determining what code to replace in the css file.

Could you be more specific about what to replace?

Or do you mean that I should just add that code from your post to the css file all together?

Just looking for more specific direction.

Thanks! :)
Anders Sylvest said…
Hey Taylor.

Yes, you should just add the code to your CSS file. The rules will override the rules in SharePoints default stylesheet. :-)

c_marius said…
Hi, SharePoint controls used for menus, navigation bars, etc. have parameters that control the Sitemap and navigation controls, including level to show, 1st element!
Have you considered that already?
Abhishek Agrawal said…
That is what I was looking for,Thanks a lot for posting this.Its saved lots of time and frustation.
Matthias said…
Hi! That's great! But I also need to choose 3 other top-navigation links to show them on a different place. How can I select them?!
agitprop said…

SP2010 uses the Sharepoint:ASPNet navigation control, which doesn't have all the properties you've mentioned. There are blog posts out there that show how to emulate SP2007 behavior by using legacy controls.
Walter said…
I'm interested in forcing all top level navigation tabs to be the same width and "wrap" the text within the tabs. Any suggestions?
Anonymous said…
I placed it in a cewp. This hides the just the title right above the navigation menu (quick launch). Awesome. Thank you!!

Replace regular parenthesis with greater or less than brackets:

.s4-tn LI.static > A {
DISPLAY: none !important
.s4-tn LI.static > UL A {
DISPLAY: block !important
ritu said…
Thanks This is working when i paste this same on my css.
Anonymous said…
For 2013 Preview

header nav ul li > a {
display: none !important;
header nav ul li ul li > a {
display: block !important;

and are my containers for the menu (html5). Using structure navigation.
Anonymous said…
Unfortunatley this doesnt work either.. it seems that pasting the code it has issues with the greater than less than. if you are using sp designer can you state exactly note for note how and where to paste this so that it would actually work?
Tim Whitchurch said…
Only works if publishing is activated on the site collection. Won't work with SPF 2010.
Vaqar Hyder said…
Works like a Charm. Thanks for sharing. it only works if you are working with a publishing sites.

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 RowTable Row Left Site Actions Navigate Up Edit Tab List Browse Page Table Row Right Give Feedback Welcome Menu WorkspaceBody Container Title Row Title Title Logo Title Text / BreadcrumbPage DescriptionSocial Data SeparatorI like It Tags/Notes Top Header 2/Top Links li Static-Selected li Static SearchHelpStatus Bar Container Main A…

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.

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 PageNavigate 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 insert > Web PartUn…