<frameset>
HTML <frameset> Tag
The <frameset> tag defines the structure of a frame (zone in the browser window, where we can load another web page), number of columns and rows, and also how many percent/pixels it will occupy in a frame.
The <frameset> is a deprecated HTML tag.
You can use the <iframe> or <div> tags with different CSS properties for getting the same result.
The pages that contain frames can be validated only if the <!DOCTYPE> is set to XHTML Frameset DTD or HTML Frameset DTD.
Syntax
Syntax (语法)
The <frameset> tag comes in pairs. The content is written between the opening (<frameset>) and closing (</frameset>) tags.
The <frameset> tag can contain one or several <frame> tags․ It is allowed to nest one <frameset> tag in another if it is necessary to divide the windows into smaller ones.
The frameset document uses the <frameset> element instead of the <body> element. The frameset element may not contain any content, but instead it defines and names frames arranged in rows and/or columns.
Example of the HTML <frameset> tag:
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<frameset cols="50%,50%">
<frame src="https://www.w3cdoc.com/learn-html/html-basic.html">
<frame src="https://www.w3cdoc.com/learn-css/css-syntax.html">
</frameset>
</html>
Result
Example of the HTML <frameset> tag with the rows attribute:
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<frameset rows="30%,40%,30%">
<frame src="https://www.w3cdoc.com/learn-javascript.html">
<frame src="https://www.w3cdoc.com/learn-git.html">
<frame src="https://www.w3cdoc.com/learn-php.html">
</frameset>
</html>
Attributes
Attributes (属性)
Attribute | Value | Description |
---|---|---|
cols | pixels%* | Defines the number and the size of frame columns.Not supported in HTML5. |
rows | pixels%* | Defines the number and the size of frame rows.Not supported in HTML5. |
The <frameset> element also supports the Global Attributes.