HTML: The Markup Language

iframenested browsing context (inline frame) # T

The iframe element introduces a new nested browsing context.

Permitted content #

Permitted attributes #

Descriptions for attributes specific to this element #

src = URI
The address of a page that the nested browsing context is to contain.
name = browsing-context name
A valid browsing context name.
width = non-negative integer
The width of the iframe, in CSS pixels.
height = non-negative integer
The height of the iframe, in CSS pixels.
sandbox = sandbox allow list NEW
Instructs the UA to enable a set of extra restrictions on any content hosted by the iframe.
seamless = "seamless" or "" (empty string) or empty NEW
Instructs the UA that the iframe element's browsing context is to be rendered in a manner that makes it appear to be part of the containing document (seamlessly included in the parent document).

Additional constraints and admonitions #

Tag omission #

An iframe element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLIFrameElement : HTMLElement {
           attribute DOMString src;
           attribute DOMString srcdoc;
           attribute DOMString name;
  [PutForwards=value] readonly attribute DOMSettableTokenList sandbox;
           attribute boolean seamless;
           attribute DOMString width;
           attribute DOMString height;
  readonly attribute Document contentDocument;
  readonly attribute WindowProxy contentWindow;
};

Typical default display properties #

iframe {
border: 2px inset; }