Forum Discussion
Any way to tighten up spacing between web parts?
- Jan 30, 2023
As RobElliott mentioned, there is no out of the box way to inject custom CSS on SharePoint online modern pages.
However, you can use SharePoint framework (SPFx) for injecting custom CSS/JS on modern pages.
- For particular site pages - use Modern script editor web part
- For all pages in sites - use SPFx application customizer
Check my answers given on these threads:
- How can I include the same JS and CSS files on multiple SharePoint Modern Page?
- Insert script in the header of the Modern page- SharePoint Online
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
As RobElliott mentioned, there is no out of the box way to inject custom CSS on SharePoint online modern pages.
However, you can use SharePoint framework (SPFx) for injecting custom CSS/JS on modern pages.
- For particular site pages - use Modern script editor web part
- For all pages in sites - use SPFx application customizer
Check my answers given on these threads:
- How can I include the same JS and CSS files on multiple SharePoint Modern Page?
- Insert script in the header of the Modern page- SharePoint Online
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.