문제

anyone idea how to add custom CSS file to SharePoint 2016.

2013 way "<SharePoint:CssRegistration ID="CssRegistration2" Name="/Style Library/css/customized.css" runat="server" After="corev15.css" />" not working.

Thanks a lot

도움이 되었습니까?

해결책

Regardless what's the way that you are using, but the following steps should be working in SharePoint 2016

  • Upload your custom CSS file to Style Library or Site Assets
  • Go to site setting > Look and Feel > Design Manager > Publish and Apply Design > Assign Master Page based on device channel .

enter image description here

  • At Alternate CSS URL > Specify a CSS file to be used by this site and all sites that inherit from it: > Browse your file.

  • Check Reset all subsites to inherit this alternate CSS URL if you need to apply this for all Subsite.

enter image description here

[Update]

After I updated your question, you were missing the format of code. so I found out you are using SharePoint:CssRegistration , So try to use it as the following

<SharePoint:CssRegistration name="&lt;% $SPUrl:~sitecollection/_catalogs/masterpage/css/customized.css %&gt;" runat="server"  />

Or

<SharePoint:CssRegistration ID="CssRegistration1" name="&lt;% $SPUrl:~sitecollection/_catalogs/masterpage/css/customized.css %&gt;" runat="server" after="SharepointCssFile" />

For more details check Starter Master Pages for SharePoint 2016

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top