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.
|
|
|||
|
|
|
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. |
|||||
|
|
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
Then upload this layout to the library and apply it to your page. |
||||
|
|