Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'd like to hide the header on my homepage (the <h1 id="pageContentTitle" .. > element.) I could use some CSS like

#pageContentTitle{ display:none; }

But because my CSS is referenced in the master file, this effects all pages on my site, where I would like to only change one.

I've also considered using some jQuery:

$('#pageContentTitle').filter(function(){
    return $(this).find('a:contains(Home)').length;
}).remove();

Which works, but has issues. Firstly the header is displayed momentarily until the JavaScript is executed, secondly this still needs to run on every page which seems like overkill.

I would have thought this would be quite a common desire so was hoping to find an option in the Page Settings but couldn't find anything yet.

Is there a better way of doing this?

share|improve this question

4 Answers 4

up vote 1 down vote accepted

Add the following CSS and reference it from your masterpage:

<style>
#aspnetForm[action*="Home.aspx"] #pageContentTitle {display:none;}
</style>

where Home.aspx is the page you want to hide the title from.

share|improve this answer
    
Brilliant, the form scope is what I needed. Thanks. –  George Aug 28 at 15:05

You can easily add a content editor webpart and add in your CSS in the HTML editor.

Or you can add your CSS to a text file, then using a content editor webpart, you can reference that text file and it will include the css in that page.

share|improve this answer
    
I've tried your suggestion, and it works, but since the content editor webpart is presumably loaded after the page load, my title still shows up momentarily before being hidden. –  George Aug 28 at 14:36
    
It is inevitably going to show for a split second before the css hides it. –  etm124 Aug 28 at 14:43
    
Sure, because the CSS is dynamically loaded. I thought there may well be an option provided by sharepoint so as to not include the header altogether. I guess not. –  George Aug 28 at 14:47

you can edit the page directly using sharepoint designer, then add your snippet of code directly, it will break the page definition... but that normally isn't a big deal.

share|improve this answer
    
I did try that yes, but like you said I got complaints about the page definition. Should I not worry about this warning? –  George Aug 28 at 14:54
    
Nope you should be good! –  etm124 Aug 28 at 14:55
    
OK, thanks for your help. –  George Aug 28 at 15:03

You could edit the page in SharePoint Designer, and add the CSS to the page.

share|improve this answer
1  
You need to add more detail about how to do it. –  Waqas Sarwar MCSE Aug 28 at 15:17
    
Did you really just edit my comment to capitalize SharePoint? Please don't make useless edits. Also, how exactly would I provide more detail? Telling him to edit the page directly, and add CSS is pretty self explanatory. –  etm124 Aug 29 at 16:03
    
check the reply marked as anwser....You answer is very open ended, dont think an expert is asking the question rather think about the person who dont know about the SharePoint –  Waqas Sarwar MCSE Aug 29 at 16:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.