Hide the navigation and the header in modern SharePoint pages
Displaying a modern SharePoint page without the navigation and the header have generated all sort of hacks over the years that try to replicate the famous ?isDlg=1 and the focus mode from classic SharePoint by manipulating the DOM and injecting custom css.
I’ve recently discovered the query string that can be used with modern SharePoint site URLs to strip the pages from all its elements living it just with the content.
By adding the query string ?env=Embedded to any modern SharePoint URL (including lists) you will be automatically removing the navigation, header and footer form the page ending just with the content.
In the following animation you can see the differences between a normal and an embedded page.
If you want to preserve the suite bar in the page you can use the query string used by Microsoft Lists – ?env=WebViewList – this however will just work with pages, when added to a list it redirects the user to the Microsoft Lists application.