1

I'm beginner in SharePoint Online so trying to remove logo showing at top left side using the Alternate CSS URL option in the Master page.

Logo that I need to remove is shown here along with its Inspect element view: http://prntscr.com/t6kpod

I used the below code in CSS:

div[class^="logoImg-62"] {
    display: none !important;
}

Need to know what i'm missing?

0

Try using below CSS:

<style>
    div[class^="logoCell-"] {
       display: none !important;
    }
</style>

Also, if it is not working using alternate CSS (As modern pages does not support this) then you can try adding it using SPFx Application customizer (if you want to hide it from all modern pages) or Modern Script Editor webpart (if you want to hide it from only one page).

References:

  1. Inject Custom CSS on SharePoint Modern Pages using SPFx Extensions
  2. Supported customizations for "modern" pages
  3. Sharepoint 365 - Add Custom CSS to Modern Pages
| improve this answer | |
  • I tried using this but no luck prntscr.com/t6vwoz – Xam Jun 26 at 11:20
  • Try using the exact CSS given in my answer. do not use the number part after - as it changes sometimes – Ganesh Sanap Jun 26 at 11:22
  • do i need to use the <style> tag as well? – Xam Jun 26 at 11:23
  • Yes, you can use the style tag...see my updated answer. – Ganesh Sanap Jun 26 at 11:24
  • thanks, i updated in the file in Site Assets location and update the path in the Alternate CSS URL as /sites/Techo/SiteAssets/LogoRemove.css , but can't see the change. – Xam Jun 26 at 11:27
0

You may try with the below CSS or PnP PowerShell.

CSS

div[class^="logoCell-119"]
 {
    display: none !important;
}

OR

img[src*='siteIcon'] { display: block;} 

Note:

  • Customizing or script editor web part is not supported in modern SharePoint online, so as an alternate we can deploy and make use of modern script editor web part.

How to inject custom CSS or javascript code in modern SharePoint Online?

We can use the modern script editor web part for this. The good thing is that we don't o need to develop this web part from the beginning, we can just deploy the modern script editor web part which is built on SPFx (alternate of classic script editor web part), we can get the modern script editor web part from here.

For details refer to the below article:

SharePoint Online, how to hide the SharePoint logo on a list using css or jquery

SharePoint Online Logo Link

| improve this answer | |
  • OP wants to remove/hide only site logo and not the complete top banner. – Ganesh Sanap Jun 26 at 0:59
  • yes i need to only remove site logo not the whole banner. – Xam Jun 26 at 11:22
  • You can use this CSS class^="logoCell-119" – Habibur Rahaman Jun 26 at 12:14
  • customization in modern isn't supported anymore, only way is to do via SPFx Application Customizer – Xam Jun 26 at 12:24
  • No need to develop this from the begining, you can just deploy the modern script editor web part which is built on SPFx (alternate of classic script editor web part), get the modern script editor web part from here. medium.com/niftit-sharepoint-blog/… – Habibur Rahaman Jun 26 at 12:27

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.