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

  • 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? – Dikesh Gandhi Jun 27 '18 at 6:15
  • Dikesh, I have double checked it and attached the screenshot. Yes using classic mode – nipuna weerasinghe Jun 27 '18 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"/>? – Gautam Sheth Jun 27 '18 at 6:55
  • Hi Gautam, second option worked, thank you very much – nipuna weerasinghe Jun 27 '18 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 ! – Gautam Sheth Jul 1 '18 at 11:29
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

| improve this answer | |
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.

| improve this answer | |

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.