HTML frame Tag

HTML <frame> Tag: The HTML<frame> tag describes a particular window within a <frameset>. HTML Frames are used to divide the web browser window into multiple section where each section can be loaded separately. This HTML frame tag is not supported in HTML5.

HTML <frame> Tag

Creating Frames

Instead of using body tag, use frameset tag in HTML to use frames in a web browser. But this Tag is deprecated in HTML 5. The frameset tag is used to define how to divide the browser. Each frame is indicated by frame tag and it basically defines which HTML document shall open into the frame. To define the horizontal frames use row attribute of frame tag in HTML document and to define the vertical frames use col attribute of frame tag in HTML document.

Syntax: <frame src=” “>



Browser compatibility

The HTML<frame> tag is supported by different types of browsers.

  • Chrome
  • Firefox
  • Opera
  • Safari
  • Internet Explorer

Example:

<!DOCTYPE html>
<html>
<frameset cols="25%,*,25%">
  <frame src="frame_a.htm">
  <frame src="frame_b.htm">
  <frame src="frame_c.htm">
</frameset>
</html>

Output:

HTML frame tag

Attributes that are supported by the <frame> tag

Attribute Value Description
frameborder 0
1
Specifies whether to display or not to display a border around a frame
longdesc URL Specifies a page that contains a long description of the content of a frame
marginheight pixels Specifies the top and bottom margins of a frame
marginwidth pixels Specifies the left and right margins of a frame
name text Specifies the name of a frame
noresize no resize Specifies that a frame is not resizable
scrolling yes
no
auto
Specifies whether or not to display scrollbars in a frame
src URL Specifies the URL of the document to show in a frame