Back to Blog
Technical

Notion Iframe Embedding: Complete Technical Reference

Marcus Johnson
13 min read
Share:
notion iframenotion embed iframeiframe notionnotion technical
NE

Iframe Basics

What is an Iframe?

<iframe src="URL" width="100%" height="600" frameborder="0"></iframe>

An iframe embeds one webpage inside another.

Key Attributes

AttributePurpose

srcURL to embed
width/heightDimensions
frameborderBorder (deprecated, use CSS)
loadingLazy loading
sandboxSecurity restrictions
allowPermissions

Notion-Specific Considerations

What Notion Embeds

Notion's embed block uses iframes for:

  • External websites

  • Media (YouTube, Spotify)

  • Maps, Forms, etc.
  • URL Requirements

  • Must be HTTPS

  • Must allow iframe embedding (X-Frame-Options)

  • Public or properly authenticated
  • Notion's Embed Block

    Notion auto-detects many services:

  • Pastes convert to embeds

  • Native integrations for popular services
  • Security Model

    Same-Origin Policy

    Iframes from different origins can't access parent:

  • JavaScript isolation

  • Cookie separation

  • DOM isolation
  • X-Frame-Options

    Servers can block iframe embedding:

    X-Frame-Options: DENY
    X-Frame-Options: SAMEORIGIN

    Some sites block embedding.

    Content Security Policy

    Modern alternative:

    Content-Security-Policy: frame-ancestors 'self' example.com

    Advanced Techniques

    Responsive Iframes

    <div style="position: relative; padding-bottom: 56.25%;
    <iframe
    style="position: absolute; width: 100%; height: 100%;"
    src="URL"
    ></iframe>
    </div>

    Lazy Loading

    <iframe src="URL" loading="lazy"></iframe>

    Sandbox Attribute

    Restrict iframe capabilities:

    <iframe src="URL" sandbox="allow-scripts allow-same-origin"></iframe>

    PostMessage Communication

    // Parent to iframe
    iframe.contentWindow.postMessage('data', 'https://target-origin.com');

    // Iframe to parent
    parent.postMessage('response', 'https://parent-origin.com');

    Embedding Notion Pages

    Basic Embed

    <iframe 
    src="https://workspace.notion.site/Page-id"
    style="width: 100%; height: 600px; border: none;"
    ></iframe>

    Issues with Native Iframes

  • Can't customize Notion styling

  • Branding remains

  • Performance concerns
  • Solution: Notion Embed

    Notion Embed handles:

  • Cross-origin issues

  • Customization

  • Performance optimization
  • FAQ

    Why doesn't my site embed in Notion?

    The site may block iframe embedding via X-Frame-Options.

    Can iframes access Notion content?

    No, same-origin policy prevents cross-origin access.

    How do I resize iframes dynamically?

    Use postMessage to communicate dimensions, or use Notion Embed.

    Conclusion

    Iframe embedding is powerful but complex:

  • Understand security implications

  • Use responsive techniques

  • Choose Notion Embed for easier implementation
  • Master your embeds!

    Professional embedding →

    ---

    Related: HTML Code | Troubleshooting

    MJ

    Marcus Johnson

    Content Creator at Notion Embed. Passionate about helping people share their knowledge with the world.

    View all posts →

    Frequently Asked Questions

    Why doesn't my site embed in Notion?

    The site may block iframe embedding via X-Frame-Options.

    Can iframes access Notion content?

    No, same-origin policy prevents cross-origin access.

    Ready to Transform Your Notion Content?

    Join thousands of creators, startups, and businesses using Notion Embed to power their websites. Get started in minutes.

    No credit card requiredSetup in 5 minutesCancel anytime