What is HTML <frame> tag ?
HTML <frame> tag defines the frame window.
HTML <frame> tag is used with the <frameset> element and <frameset> holds one or more <frame> elements.
HTML <frame> tag remove in HTML5 specification.
How HTML <frame> tag works ?
HTML <frameset> tag splits the browser window in several individual frames that can contain a separate HTML web document.
HTML <frameset> tag divides a webpage into multiple sections or frames, and each frame can contain different web pages.
And HTML <frame> is specific window or a frame, where we can load another web page.
We can use the “src” attribute to define the address of this web page.
A single web page can have several such frames.
Why HTML <frame> tag is used ?
HTML <frame> tag used improve appearance and usability of a site.
Note: HTML <frame> tag as it is not supported in HTML5, instead we can use <iframe> or <div> with CSS to achieve similar effects in HTML.
HTML beginners tutorial !!!
Click to Learn More about – HTML Tutorial for beginners
Syntax :
<frameset cols="50%,50%">
<frame src="frame1.html" />
<frame src="frame2.html" />
</frameset>
Frame1.html
<html>
<body style="background-color:green;">
<h2 align="center">Frame 1</h2>
</body>
</html>
Frame2.html
<html>
<body style="background-color:yellow;">
<h2 align="center">Frame 2</h2>
</body>
</html>
Main.html
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<frameset cols="50%,50%">
<frame src="frame1.html">
<frame src="frame2.html">
</frameset>
</html>
Output :
<frame> Tag Attributes
HTML <frame> tag support following specific attributes. All following attributes has been removed in HTML5.
Sno | Attributes | Value | Description |
---|---|---|---|
1 | frameborder | 0 1 | Specify whether display a border or not. |
2 | longdesc | url | Specify URL link to another page having a long description of the frame contents. |
3 | marginheight | pixel_size | Specify the top and bottom margins of frame. |
4 | marginwidth | pixel_size | Specify the left and right margins of frame. |
5 | name | name | Specify the frame name. |
6 | noresize | noresize | Specify that prevents to resize frame. |
7 | scrolling | auto yes no | Specify weather scrollbars should be display or not. |
8 | src | url | Specify web document URL to show in a frame. |
Global Attributes
HTML <frame> tag support following global attributes.
Sno | Attributes | Value | Description |
---|---|---|---|
1 | id | unique_name | Declared unique id for an element. |
2 | class | class_name | Declared one or more classnames for an element. |
3 | style | styles | CSS inline styles specify an element. |
4 | title | title | Specify extra details of element contain, this will display as a “tooltip” for an elements. |
Event Attributes
HTML <frame> tag does not support any event attributes.
Browser Compatibility
Sno | Browser | Support |
1 | Chrome | Yes |
2 | Firefox | Yes |
3 | Edge | Yes |
4 | Opera | Yes |
5 | Safari | Yes |
6 | Internet Explorer | Yes |