I want to apply custom CSS to a team site Seattle master page in SharePoint 2013. Is there any way available to do this without activating publishing feature?

I tried adding <link> tag in masterpage, but it doesn't take any effect.


Upload your css to the master page gallery or site assest folder, you can create a folder in your master page gallery and upload your CSS file there either manually or using a module in Visual Studio. Then you can refernce it using :

<SharePoint:CssRegistration name="&lt;% $SPUrl:~sitecollection/_catalogs/masterpage/YourSiteFolder/YourCSSFile.css %&gt;"
  • Hi Ankit, Should I add above line in Seattle.html? – P S Dec 13 '16 at 8:45
  • Before that you need to have your custom css file in master page gallery – Ankit Kumar Dec 13 '16 at 8:48
  • Yes I have added CSS file in master page gallary. But when I add above line in Seattle.html and Preview, it throws me error that "SharePoint can't parse this file, most likely because of an incorrectly formatted SharePoint snippet." – P S Dec 13 '16 at 8:54
  • I added below line in HTML file and it worked <!--SPM:<SharePoint:CssRegistration name="&lt;% $SPUrl:~SiteCollection/Style Library/Custom Style/CustomCSS.css %&gt;" runat="server" after="corev15.css"/>--> – P S Dec 13 '16 at 9:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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