HTML <frame> Tag
Example
A simple three-frame page:
Browser Support
All major browsers support the <frame> tag.
Tag Definition and Usage
The <frame> tag defines a subwindow (frame) within a <frameset>.
Each <frame> in a <frameset> can have different attributes, such as border, scrolling, noresize, etc.
Note: If you want to validate a page containing frames, make sure the <!DOCTYPE> is set to "HTML Frameset DTD" or "XHTML Frameset DTD".
Differences Between HTML 4.01 and HTML5
HTML5 does not support the <frame> tag; HTML 4.01 supports the <frame> tag.
Differences Between HTML and XHTML
In HTML, the <frame> tag has no closing tag. In XHTML, the <frame> tag must be properly closed.
Optional Attributes
| Attribute | Value | Description |
|---|---|---|
| frameborder | 0 <br>1 | Not supported in HTML5. Specifies whether to display a border around the frame. |
| longdesc | URL | Not supported in HTML5. Specifies a page that contains a long description of the frame's content. |
| marginheight | pixels | Not supported in HTML5. Specifies the margin height at the top and bottom of the frame. |
| marginwidth | pixels | Not supported in HTML5. Specifies the margin width at the left and right of the frame. |
| name | name | Not supported in HTML5. Specifies the name of the frame. |
| noresize | noresize | Not supported in HTML5. Specifies that the frame cannot be resized. |
| scrolling | yes <br>no <br>auto | Not supported in HTML5. Specifies whether to display scrollbars in the frame. |
| src | URL | Not supported in HTML5. Specifies the URL of the document to display in the frame. |
Standard Attributes
In HTML 4.01, the <frame> tag supports the following standard attributes:
| Attribute | Value | Description |
|---|---|---|
| class | classname | Specifies a class name for the element. |
| id | id | Specifies a unique id for the element. |
| style | style_definition | Specifies inline styles for the element. |
| title | text | Specifies extra information about the element. |
For a complete description, visit Standard Attributes.
Event Attributes
According to the W3C standard, the <frame> tag does not support any event attributes in HTML 4.01.
However, all browsers support the onload event.
For a complete description, visit Event Attributes.