Trying to Hide the Site Header of a communication site


Hi Experts,


I have the requirement to hide the Site Header portion f a SharePoint Communication site.

We can do the same by applying the css "mainRow-xx{ display:none;"}  in the application customizer.

But it is not recommended by the Microsoft and also it is not applicable to all the pages of te site collection.

Can we find the main control of the site header as Object (not css class name, control class name)  in the page. So that in the Application customizer we can get the Object and if the object contains the property of visible.


Appreciate your help.

1 Reply
best response confirmed by Asesh Kumar Maity (Contributor)

Hi @Asesh Kumar Maity  as you say, It’s not recommended to trim the ribbon or suite bar.

Btw, you can realize a spfx webpart which include css or js (something like this ) or use this Modern Script Editor Webpart