0

I have site pages like Home.aspx, Contact.aspx in SP 2019 on premise. How to apply custom CSS stylesheet to those pages? I have added Override.css to the seattle.master page which is my current master page, but the custom file does not load. This does not seem to work at all. How to make sure to link the custom stylesheet to the Home.aspx and other site pages? Thanks

None of these worked

<SharePoint:CssRegistration Name="_catalogs/masterpage/Override.css" After="corev15.css" runat="server" />
<SharePoint:CssRegistration name="https://one.echristus.net/sites/test-TFS/Style%20Library/Override.css" runat="server"/>
<link rel="stylesheet" type="text/css" href="https://one.echristus.net/sites/test-TFS/Style%20Library/Override.css" />
<link rel="stylesheet" type="text/css" href="_catalogs/masterpage/Override.css" />
5
  • You need to add details like what script tags you are using in your master page and what process did you follow when doing the changes/creating the masterpage. Commented Jul 5, 2022 at 18:52
  • <SharePoint:CssRegistration Name="/_catalogs/masterpage/cusTheme/cus.css" runat="server" after="corev15.css" /> Works for me in 2013/2016. Are you sure that it's nothing that is getting cached? Are you using minimal download strategy? Have you made sure that you published your masterpage as a major version after doing the changes? Commented Jul 6, 2022 at 7:12
  • Yes @Christoffer I have published my masterpage's major version. The CSS file is not even loading in the Home page. I need to look for minimal download strategy though. Any idea on how to overcome minimal download strategy? I am currently referring to MS official documentation over that topic. Thanks Commented Jul 6, 2022 at 14:43
  • Are you using modern or classic layout for your sites? Commented Jul 7, 2022 at 5:51
  • Its the modern layout @Christoffer Commented Jul 7, 2022 at 14:39

1 Answer 1

0

You can use SharePoint:AjaxDelta container for loading components in MDS mode. Please try this. Resources: MSDN MDS Optimize page performance in SharePoint

If you use Modern pages you need create custom actions in SPFX.

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.