The iframe element creates an inline frame that contains another document.
Supported In HTML4: Yes
Supported In HTML5: Yes
HTML4 vs HTML5 Differences: HTML 5 has some new attributes, and some HTML 4.01 attributes are not supported in HTML 5.
Attributes
| Title | Values | Description | HTML4 Support | HTML5 Support |
| frameborder | 1 0 | Yes | No | |
| height | pixels % | Defines the height of the iframe. | No | No |
| longdesc | URL | No | No | |
| marginheight | pixels | No | No | |
| marginwidth | pixels | No | No | |
| name | framename | Specifies a unique name of the iframe. | No | No |
| sandbox | allow-forms allow-same-origin allow-scripts | Defines restrictions to the frame content. | No | No |
| scrolling | yes no auto | No | No | |
| seamless | seamless | If present, the iframe should appear as if it is part of the document the iframe is in. | No | No |
| src | URL | The URL of the document to show in the iframe | No | No |
| srcdoc | HTML | The HTML of the document showing in the iframe | No | No |
| width | pixels % | Defines the width of the iframe. | No | No |
Standard Attributes
All standard attributes are supported.
Event Attributes
All event attributes are supported.
HTML5 Tags
- a
- abbr
- acronym
- address
- applet
- area
- article
- aside
- audio
- b
- base
- basefont
- bdo
- big
- blockquote
- body
- br
- button
- canvas
- caption
- center
- cite
- code
- col
- colgroup
- command
- datalist
- dd
- del
- details
- dfn
- dir
- div