<portal>

The <portal> element is not included in the official HTML specification. Instead, you can use <iframe> or web components to embed external content or create interactive sections within a webpage.

<portal> Tag

The <portal> HTML element is an experimental feature that enables embedding another web page within the current document, allowing a seamless transition to the embedded content.

Syntax

index.html
<portal src="URL"></portal>

Portal Demo

Qarpeo
index.html
<portal src="https://institute.qarpeo.com">Qarpeo</portal>

Key Points

  • Purpose: Provides a preview of an external page, allowing smooth navigation to it.
  • Difference from <iframe>: Unlike <iframe>, content within a <portal> cannot be interacted with, making it unsuitable for embedding interactive elements.

Attributes

  • src: Specifies the URL of the external page to be embedded.
  • referrerpolicy: Determines the referrer policy for requests made to the embedded page.

Conclusion

The <portal> HTML element is an experimental feature designed to allow embedding another web page within the current document. It provides a seamless way to preview external content, enabling easy navigation. Unlike <iframe>, the embedded content within <portal> cannot be interacted with, making it unsuitable for embedding interactive elements.