Open In App

HTML frame Tag

Last Updated : 11 Jul, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

HTML <frame> tag is used to divide web browser windows into multiple sections, each capable of loading content independently. This is achieved using a collection of frames within a frameset tag.

Note: The <frame> tag is deprecated in HTML 5.

html
<!DOCTYPE html>
<html>

<body>
    <frameset rows="20%, 60%, 20%">
        <frame name="top" 
               src="./attr1.html" />
        <frame name="main" 
               src="./gradient.html" />
        <frame name="bottom" 
               src="./colLast.html" />
        <noframes>
            <p>The browser you are using does not support frames.</p>
        </noframes>
    </frameset>
</body>

</html>

The above example basically used to create three horizontal frames i.e. top, middle and bottom using row attribute of frameset tag and the noframe tag is used for those browser who doesn't support noframe.

Syntax

<frameset cols="50%, 50%">
<frame src="page1.html">
<frame src="page2.html">
</frameset>

HTML frame Tag Attributes

HTML <frame> name Attribute

This attribute is used to give names to the frame. It differentiate one frame from another. It is also used to indicate which frame a document should loaded into.

Example

 <frame name = "top" src = "C:/Users/dharam/Desktop/attr1.png" />
 <frame name = "main" src = "C:/Users/dharam/Desktop/gradient3.png" />
 <frame name = "bottom" src = "C:/Users/dharam/Desktop/col_last.png" />

Here we use three frames with names as left center and right.

HTML <frame> src Attribute

This attribute in frame tag is basically used to define the source file that should be loaded into the frame.The value of src can be any url.

Example

<frame name = "left" src = "/html/left.htm" />

In the above example name of frame is left and source file will be loaded from "/html/left.htm" in frame.

HTML <frame> marginwidth Attribute

This attribute in frame tag is used to specify width of the spaces in pixels between the border and contents of left and right frame.

Example

<frame marginwidth="20">

HTML <frame> marginheight Attribute

This attribute in frame tag is used to specify height of the spaces in pixels between the border and contents of top and bottom frame.

Example

<frame marginheight="20">

HTML <frame> scrollbar Attribute

To control the appearance of scroll bar in frame use scrollbar attribute in frame tag. This is basically used to control the appearance of scrollbar. The value of this attribute can be yes, no, auto. Where the value no denotes there will be no appearance of scroll bar.

Example

<frame scrollbar="no">

HTML | <frame> Tag

Similar Reads