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

We're inserting web parts into a publishing page and noticing that SharePoint wraps their title in H3 tags by default. Is there a way to control this? We need it to insert the title as H2, at least in one section of the page? We're tempted to use jQuery to parse the HTML and replace the tags, but wondered if there's any other way. Thanks.

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

If you want to selectively change the styles of title in a particular section/webpart, using jquery selector to locate those web part titles and change the styles is an appropriate option.

If you want to change the styles across all pages, I would suggest overriding the default webpart title style using CSS instead of replacing h3 with h2. You can override

.ms-WPHeader TD H3

I came across a nice article here if it helps.

share|improve this answer
    
as I understand Alex wants to change the styles in a section of page, not whole the page. –  Alexander Dec 4 '11 at 16:40
    
The first paragraph addresses it. –  Ashish Patel Dec 4 '11 at 16:54
add comment

If you should change a style only in a part of page you can take a page layout that is used by this page from master page and layouts library, make a copy of this layout. Then open this layout and wrap a part of page that should has your style to the some div and define its class. after this you can override styles on the page like this

.yourDiv .ms-WPHeader TD H3
{
     font-size: 12px;
}

Then upload this layout to the library and apply it to your page.

share|improve this answer
add comment

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.