The HTML component represents a nest shop context, embedding another HTML page into the current one .
Each embedded browsing context has its own session history and document. The browsing context that embeds the others is called the *parent browsing context*. The *topmost* browse context — the one with no rear — is normally the browser window, represented by the Window
object .
Warning: Because each browsing context is a complete document environment, every in a page requires increased memory and early computing resources. While theoretically you can use as many
s as you like, check for performance problems .
Content categories | Flow content, phrasing content, embedded content, interactive content, palpable content. |
---|---|
Permitted content | None. |
Tag omission | None, both the starting and ending tag are mandatory. |
Permitted parents | Any element that accepts embedded content. |
Implicit ARIA role | No corresponding role |
Permitted ARIA roles | application , document ,img , none ,presentation |
DOM interface | HTMLIFrameElement |
These attributes are deprecated and may no long be supported by all user agents. You should not use them in newly content, and try to remove them from existing content.
align
- The alignment of this component with obedience to the surrounding context .
frameborder
- The respect
1
( the default ) draws a edge around this inning. The respect0
removes the border around this ensnare, but you should rather use the CSS placeborder
to controlborders .
longdesc
- A URL of a farseeing description of the frame ‘s capacity. ascribable to far-flung misapply, this is not helpful for non-visual browsers .
marginheight
- The sum of distance in pixels between the frame ‘s content and its circus tent and bottom borders .
marginwidth
- The come of quad in pixels between the frame ‘s capacity and its left and right borders .
scrolling
- Indicates when the browser should provide a scrollbar for the frame :
auto
: Only when the frame’s content is larger than its dimensions.yes
: Always show a scrollbar.no
: Never show a scrollbar.
Inline frames, like elements, are included in the
window.frames
pseudo-array .
With the DOM HTMLIFrameElement
object, scripts can access the window
aim of the framed resource via the contentWindow
property. The contentDocument
property refers to the document
inside the , same as
contentWindow.document
.
From the inside of a frame, a script can get a reference to its rear window with window.parent
.
Script access to a frame ‘s subject is subjugate to the same-origin policy. Scripts can not access most properties in early window
objects if the script was loaded from a different beginning, including scripts inside a frame accessing the frame of reference ‘s parent. Cross-origin communication can be achieved using Window.postMessage()
. As a supplant component, the position, alignment, and scale of the embed document within the component ‘s box, can be adjusted with the
object-position
and object-fit
properties. This example embeds the page at hypertext transfer protocol : //example.org in an iframe .
HTML
<
iframe
src
=
“
https://example.org
“
title
=
“
iframe Example 1
“
width
=
“
Read more: Building Java Projects with Gradle
400
“
height
=
“
300
“
>
iframe
>
Result
People navigating with assistive engineering such as a screen lector can use the title
assign on an to label its content. The title ‘s value should concisely describe the embedded capacity :
<
iframe
title
=
“
Flickroom page for Avocados
“
src
=
“
https://en.wikipedia.org/wiki/Avocado
“
>
iframe
Read more: How to Use Google Forms
>
Without this title, they have to navigate into the to determine what its embedded content is. This context switch can be jumble and time-consuming, specially for pages with multiple
second and/or if embeds contain synergistic content like video or audio. BCD tables only warhead in the browser