Can we hide below from modern UI pages using css?
2 Answers
For your requirement you need to use the custom css on the Modern page (Not good practice though).
Try using below CSS:
<style>
div.commandBarWrapper {
display: none !important;
}
</style>
To add this code you will need a script editor web part. Below is the Modern Script Editor web-part created using SPFx:
-
Try this and let me know if this works for you. I can provide you the SPFx package(.sppkg) file of modern script editor if you need. Sep 23, 2019 at 15:17
-
1
-
-
If you want to hide the page title and command bar for all the modern page, we can create an application customizer to inject the CSS style below to achieve it.
div[class^='pageTitle_']{
display: none !important;
}
div.commandBarWrapper {
display: none !important;
}
Source code: SPFx Applications Customiser CSS Injection