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 rows and columns 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 a web browser. This attribute is basically used to define the no. of columns and their size inside the frameset tag.
- rows: The rows attribute is used to create horizontal frames in the web browser. This attribute is used to define the no. of rows and their size inside the frameset tag.
- border: This attribute of frameset tag defines the width of the border of each frame in pixels. Zero value is used for no border.
- frameborder: This attribute of frameset tag is used to specify whether a three-dimensional border should be displayed between the frames or not for this use two values 0 and 1, where 0 defines no border and value 1 signifies for yes there will be a 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 a parameter which basically denotes the value in pixel.
Below examples illustrate the <frameset> element in HTML:
Example 1:
HTML
<!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 > |
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 that doesn’t support noframe.
Example 2:
HTML
<!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 > |
Output:
The above example basically used to create three vertical frames: left, center, and right using col attribute of frameset tag.
Supported Browsers:
- Google Chrome
- Internet Explorer
- Firefox
- Opera
- Safari
Please Login to comment...