<fencedframe>
<fencedframe>
Element
The <fencedframe>
element in HTML is designed for embedding external web pages while maintaining a secure and isolated browsing environment. It differs from the <iframe>
in several ways:
- It restricts communication between the embedded content and the parent page.
- It allows access to cross-site data while ensuring user privacy.
- Unlike
<iframe>
, standard JavaScript cannot modify or retrieve its contents directly. - The embedding page cannot interact with the DOM inside the
<fencedframe>
, and vice versa.
Attributes
The <fencedframe>
element includes the following attributes:
allow
- Defines a Permissions Policy, specifying which features the embedded content can access based on its origin.
height
- Specifies the height of the fenced frame in CSS pixels. The default value is 150.
width
- Specifies the width of the fenced frame in CSS pixels. The default value is 300.
Example
<iframe src="https://institute.qarpeo.com" width="800" height="600" frameborder="0" allowfullscreen></iframe>
<iframe>
in this example embeds content from "https://institute.qarpeo.com" with a width of 800 pixels
and a height of 600 pixels
. It has no visible border and supports fullscreen mode.Conclusion
The <fencedframe>
element provides a secure way to embed external web content, ensuring isolation between the parent page and the embedded content. It restricts interactions like JavaScript access, preventing direct communication between the two. It includes attributes such as height
and width
for customizing the embedded content's permissions and dimensions.
<iframe>
The HTML <iframe> element allows embedding an external HTML document within the current page, facilitating the integration of content such as videos or interactive elements.
<noframes>
The (<noframes>) tag displays fallback content for browsers that don’t support frames. It is now obsolete as frames are rarely used in modern web design.