Techcss
Untitled Document

HTML Frame

To display multiple HTML documents as splitted in the browser window the <frame> elements are used widely with its various attributes.


The <frameset> tag

The <frameset> tag is used in the main document (top level document) to define a window containing frames. The basic attributes of <frameset> tag are 'rows' and 'cols'.

<frameset rows="25%,*,20%">.........</frameset>

OR

<frameset cols="20,*,20">.........</frameset>


The <frame> tag code

The <frame> tag is used within <frameset> tag to specify the HTML file to be displayed in the concerned frame with attribue value.

The URLs of the files are to be specified using the 'src' attribute.


Example:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>

<body>
<frameset cols="40%,30%,*">
<frame src="banner.html">
<frame src="menu.html">
<frame src="content.html">
</frameset>
</body>
</html>

Note: The asterisk (*) represents the remaining space available in the page.