I have a problem that requires me to remove all masterpage styles from my layout page and add custom css styles to the layout. I have been able to add the custom css to the layout but don't know how to remove the masterpage styles.

I will like to know if its possible and if possible, how can I do it?


2 Answers 2


So if I understood your question, you have only a specific page where you want not to have the same styles as you have in the masterpage. If this is so, you can:

1) Create a new master page (let's say master2.master) as a copy of the current masterpage, where you delete all styles you don't want to have in the specific page.

2) In the page where you don't want to have the master styles, find the <%@ Page %> directive and set your new created master inside the MasterPageFile attribute:

<%@ Page language="C#" MasterPageFile="_catalogs/masterpage/master2.master"    
  • Thanks Xavi, do I then create a layout using the new masterpage after step 1 Commented Aug 27, 2015 at 13:56
  • Yeap I thought you had this, as you said " I have been able to add the custom css to the layout but don't "... give it a try :)
    – Xavi
    Commented Aug 27, 2015 at 14:00
  • after creating the master-page copy, I couldnt create a layout from that master-page, the page layout creation page is not detecting the new copy Commented Aug 27, 2015 at 14:05
  • where am i suppose to find this line <%@ Page language="C#" MasterPageFile="_catalogs/masterpage/master2.master" ..... the layout or page Commented Aug 27, 2015 at 14:10
  • You will need to provide more information, are you working in VS ? are you trying to do this directly in the site collection? etc. Explain more in detail your situation. If you're using VS try this link
    – Xavi
    Commented Aug 27, 2015 at 14:10

To use a custom primary master page in your SharePoint sites, you can:

Customize a copy of the default primary master page (v4.master), or

Create a new custom master page from scratch, and make it the primary master page for your site.

Source: Customize a master page to brand your site

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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