Fix Extra Content Around a SharePoint Calendar in an iframe
Question details
The user wants to display a SharePoint calendar in an iframe without surrounding headers or other page content.

- Product
- Microsoft SharePoint
- Device & OS
- not provided
- Scenario
- A SharePoint calendar page is embedded in another page using an iframe.
- Observed behavior
- Headers or other content from the embedded SharePoint page appear outside the intended calendar area.
Open the iframe's source URL directly and check whether the calendar is on a classic or modern SharePoint page. Confirm that you have permission to edit the embedding page and, if needed, customize the calendar page.
Test a dialog-style URL on a classic SharePoint calendar
Use this approach to check whether a classic SharePoint page can display the calendar with less surrounding page content.
Changing the iframe's dimensions or margins does not remove headers from the page loaded inside it. The IsDlg parameter controls dialog-style rendering on some classic SharePoint pages, but its effect depends on the page and SharePoint version.
Edit the page containing the iframe and copy the calendar URL from the iframe's src attribute.
Open the URL in a browser and append ?IsDlg=1, or &IsDlg=1 if the URL already contains a question mark. Check whether the unwanted page elements are hidden.
If the test works, replace the iframe's src URL with the tested URL, save the page, and check the embedded calendar.

Hide unwanted elements on the classic calendar page
Use page-level CSS when you can customize the embedded classic page and the URL parameter does not produce the desired result.
Use the Group Calendar web part on a modern SharePoint page
If the calendar belongs to a Microsoft 365 group, use the native web part instead of embedding the full calendar page.
Plan schedules and edit Office files with WPS Office
WPS Office is a free, lightweight alternative for creating schedules and editing Office files in a familiar interface. Its Microsoft Office format support makes it easy to move existing documents into your workflow, although it does not fix SharePoint iframe rendering.

Frequently Asked Questions
Why don't negative iframe margins remove the SharePoint header?
Margins change the iframe's position or visible area; they do not remove elements from the SharePoint page inside it. Change the embedded page or test a dialog-style URL on a classic page instead.
Should I use IsDlg=0 or IsDlg=1?
On some classic SharePoint pages, IsDlg=1 requests dialog-style rendering and may hide surrounding elements. IsDlg=0 generally does not request that rendering. Test the URL directly because behavior varies by page and version.
Can CSS on the embedding page hide content inside the iframe?
Generally, no. The iframe contains a separate document, so CSS on the host page does not style its internal elements. Apply an approved customization to the embedded page instead.
Is there a modern SharePoint option that avoids an iframe?
For a Microsoft 365 group calendar, edit the modern page and add the Group Calendar web part. The group and its events must be accessible to the intended viewers.




