HTML | frameset Tag

The <frameset> tag in HTML is used to define the frameset. The <frameset> element contains one or more frame elements. It is used to specify the number of row and column in frameset with their pixel of spaces. Each element can hold a separate document.

Note: The <frameset> tag is not supported in HTML5.

Syntax:

<frameset cols = "pixels|%|*">

Attributes: The list of frameset attributes are given below:

  • cols: The cols attribute is used to create vertical frames in web browser. This attribute is basically used to define the no of columns and its size inside the frameset tag.
  • rows: The rows attribute is used to create horizontal frames in web browser. This attribute is used to define no of rows and its size inside the frameset tag.
  • border: This attribute of frameset tag defines the width of border of each frames in pixels. Zero value is used for no border.
  • frameborder: This attribute of frameset tag is used to specify whether three dimensional border should be displayed between the frames or not for this use two values 0 and 1, where 0 defines for no border and value 1 signifies for yes there will be border.
  • framespacing: This attribute of frameset tag is used to specify the amount of spacing between the frames in a frameset. This can take any integer value as an parameter which basically denotes the value in pixel.

Below examples illustrate the <frameset> element in HTML:

Example 1:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html> 
<html
    <head
        <title>frameset attribute</title
    </head
      
    <!-- frameset attribute starts here -->    
    <frameset rows = "20%, 60%, 20%"
        <frame name = "top" src = "attr1.png" /> 
        <frame name = "main" src = "gradient3.png" /> 
        <frame name = "bottom" src = "col_last.png" /> 
        <noframes
            <body>The browser you are working does not
                                  support frames.</body
        </noframes
    </frameset
    <!-- frameset attribute ends here -->
</html>                                

chevron_right


Output:
The above example basically used to create three horizontal frames: top, middle, and bottom using row attribute of frameset tag and the noframe tag is used for that browser who doesn’t support noframe.

Example 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>     
    <head
        <title>frameset attribute</title
    </head
          
    <frameset cols = "30%, 40%, 30%"
        <frame name = "top" src = "attr1.png" /> 
        <frame name = "main" src = "gradient3.png" /> 
        <frame name = "bottom" src = "col_last.png" />         
        <noframes
            <body>The browser you are working does
            not support frames.</body
        </noframes
    </frameset
</html>                                    

chevron_right


Output:
The above example basically used to create three vertical frames: left, center and right using col attribute of frameset tag.

Supported Browser: The browser supported by <frameset> tag are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.