2

Can some one please tell me why this is not working, I m using SharePoint online On second line I m referring to the custom css. enter image description here

CSS

<style type="text/css">  
    #DeltaPlaceHolderSearchArea {  
        display: none;  
    }  
</style> 

enter image description here

5
  • Can you please double check the css path? If it's correct or not. I am assuming that you are using classic experience in sharepoint online site? Commented Jun 27, 2018 at 6:15
  • Dikesh, I have double checked it and attached the screenshot. Yes using classic mode Commented Jun 27, 2018 at 6:25
  • can you check it as <link rel="stylesheet" type="text/css" href="/_catalogs/masterpage/Style Library/customcss.css" /> or <SharePoint:CssRegistration name="<% $SPUrl:~SiteCollection/_catalogs/masterpage/Style Library/customcss.css%>" after="corev15.css" runat="server"/>? Commented Jun 27, 2018 at 6:55
  • Hi Gautam, second option worked, thank you very much Commented Jun 27, 2018 at 10:44
  • Cool, have posted it as answer, please accept it by ticking the checkmark besides the answer ! You will get a learner badge as well, cheers , thanks ! Commented Jul 1, 2018 at 11:29

2 Answers 2

0

Don't do this. You can easily add a reference to a new css without editing the master page. There is a property on the web object called AlternateCSSUrl that can be set to ref your css. Use it instead. This will give you a start: Setting AlternateCssUrl in all subsites

0

As mentioned in the comments, you can reference css files using link tags or using SharePoint:CssRegistration as below:

<link rel="stylesheet" type="text/css" href="/_catalogs/masterpage/Style Library/customcss.css" />

or

<SharePoint:CssRegistration name="<% $SPUrl:~SiteCollection/_catalogs/masterpage/Style Library/customcss.css%>" after="corev15.css" runat="server"/>

When you use CssRegistration along with the ~SiteCollection token, SharePoint will convert it to the correct site collection URL and render it on the page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.