0

I am seeking to apply Script or css to root SharePoint site which should get effected to all the site collections and remove Left Navigation and "Edit Links" option which exists on Top link bar.

2 Answers 2

2

No need for MasterPage changes

You can load a CSS file as UserCustomAction for the whole Site Collection (or one Web)

Note: Your CSS could be loaded before SharePoint CSS, so you need to set your CSS Specificity right on all selectors so they overrule the later loaded CSS files

This is also the best way to load any JS Library

1
0

To remove left navigation, add below style into master page:

 #sideNavBox {display: none}

To remove edit links from top navigation, add below style into master page:

#DeltaTopNavigation .ms-core-listMenu-root .ms-listMenu-editLink {display: none;}

Hope it works for you!

3
  • To add: you might want to deploy the style change via PowerShell if you are not using a general masterpage/stylesheet where the changes could be done conveniently. To do so, see sharepoint.stackexchange.com/questions/176142/…
    – moe
    Jun 9, 2017 at 10:26
  • Seeking for solution which should get apply from root site to all other sub sites
    – MSA
    Jun 9, 2017 at 10:58
  • yes, you will need to add this style into site collection master page.If all subsites inherited this master page then it will automatically worked for all subsites. Jun 9, 2017 at 11:03

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.