Posts in current category

HTML5 <iframe> tag

May 03, 2021 16:00 HTML5

Table of contents


Mark an inline framework with html5 and; tags:

<iframe src=""></iframe>
Try it out . . .

Browser support

HTML5 <iframe> tag HTML5 <iframe> tag HTML5 <iframe> tag HTML5 <iframe> tag HTML5 <iframe> tag

All major browsers support the hashtags.

Label definition and instructions for use

The label specifies an inline framework.

One inline framework is used to embed another document in the current HTML document.

Tips and comments

Tip: You can place the text you want between the slt; iframe and slt;/iframe sgt; so that you can handle browsers that don't support the slt; iframe.

Tip: Use CSS to define styles for slt;iframe,including scroll bars.

The difference between HTML 4.01 and HTML5

HTML5 has added some new properties and removed some of the properties from HTML 4.01.

The difference between HTML and XHTML

In XHTML, the name property is discarded and will be removed. Use the id property instead.


New: The new property in HTML5.

Property Value Describe
align (abandoned) left
HTML5 is not supported. H TML 4.01 is obsolete. Specify how to align according to the surrounding elements.
frameborder 1
HTML5 is not supported. Specify whether to display the border around the .
height pixels Specifies the height of the slt;iframe.
longdesc Url HTML5 is not supported. Specify a page that contains a longer description of the .
marginheight pixels HTML5 is not supported. Specify the margins at the top and bottom of the slt;iframe.
marginwidth pixels HTML5 is not supported. Specify the margins on the left and right sides of the .
name name Specifies the name of the name of the slt;iframe.
sandbox New ""
Define a series of additional restrictions on the content of slt;iframe.
scrolling yes
HTML5 is not supported. Specify whether to display a scroll bar in slt;iframe.
seamless New seamless The rule is that it looks like part of the parent document.
Src Url Specifies the URL of the document that is displayed in slt;iframe.
srcdoc New HTML_code The HTML content on the specified page is displayed in slt;iframe.
width pixels Specifies the width of the slt;iframe.

Global properties

The label supports the global properties of HTML.

The event property

The tag supports the event properties of HTML.

Related articles

HTML tutorial: HTML framework

HTML DOM Reference Manual: IFrame Object