1

I am using Office 365 and having a horrible time setting CSS for sub-sites.

I have set my Alternate CSS set at https://site.sharepoint.com/_layouts/15/ChangeSiteMasterPage.aspx but even though it is set to work for all sites it is only working for the top-level site.

enter image description here

I would like this CSS file to be inherited by all of the sub-sites.

Thanks, Josh

  • Have you set this option on all sub-sites or just Parent site? – Ganesh Sanap Jul 26 at 5:38
  • Thank You @GaneshSanap, I thought this would push it down. It works on all the pages other than Web Part pages. The Web Part pages do not take any CSS and the old trick of adding CSS as a web part is not working because the is no HTML web part any longer. Any ideas are appreciated. Thanks, Josh – Josh Jul 26 at 5:54
  • Settings this option in all sub-sites is working except web part pages, right? For web part pages I guess you can add Content Editor or Script Editor web part to set the CSS. – Ganesh Sanap Jul 26 at 5:58
  • I do not have either of those Web Parts available. It is a new format of Web Part page I have not seen before. I cannot share a screenshot in this box but it is a sub-set of the "normal" Web Parts. – Josh Jul 26 at 6:05
  • In SharePoint online, in order to add the Content Editor web part, you need to enable Custom Script feature from admin center, Reference. – Ganesh Sanap Jul 26 at 6:07
0

If it is not working as you are setting then you can set the Alternate CSS URL option on all your Sub-sites specifying the URL of CSS file you want to apply.

Enable Content Editor in SharePoint Online:

Follow below steps:

  1. Go to SharePoint admin center using URL : https://DOMAIN-admin.sharepoint.com/
  2. Go to Tenant Settings using URL: https://DOMAIN-admin.sharepoint.com/_layouts/15/online/TenantSettings.aspx
  3. Scroll down to Custom Script > Allow users to run custom script on self-service created sites
  4. It takes about 24 hours for the change to take effect.
  5. Replace DOMAIN in URL with your domain, before clicking on link.

Reference:

  1. Content Editor Web Part missing in Office 365 Dev.
  2. Missing web part and features in office 365.
  3. Allow or prevent custom script.
0

Since these pages were set up as New/Modern (Post 2016) pages this technique does not work for those pages.

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.