Frames in HTML

This lecture notes is based on Prof Doreen De Leon's lectures.

Reading

Sebesta Section 2.9

Example

Example 1

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title>A Simple Frames Example</title>
</head>

<frameset cols="40%,*">
<frame src="http://www.math.ucla.edu" name="math" />
<frame src="http://www.math.ucla.edu/~ccli/index.html" name="prof" />
<noframes>
<body>
<p>
Sorry, this document can be viewed only with a frames-capable browser.
Click on <a href="http://www.math.ucla.edu">Math Web Page</a> to be
taken to the first page in the series.

</p>
</body>
</noframes>
</frameset>

</html>
Change the frameset line to (1) <frameset cols="200,*">   (2) <frameset rows="40%,*">
Example 2
<frameset cols="40%,20%,40%">
<frame src="http://www.math.ucla.edu" name="math" />
<frame src="http://www.math.ucla.edu/~ccli/index.html" name="prof" />
<frame src="http://www.yahoo.com" name="yahoo" />


Example 3
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title>Frames Example 3</title>
</head>

<frameset cols="200,*">
<frame src="http://www.math.ucla.edu/~ccli" name="prof">
<frameset rows="60%,*">
<frame src="http://www.math.ucla.edu" name="math">
<frame src="http://www.google.com" name="google">
</frameset>
</frameset>
<body>
<p>
Sorry, this document can be viewed only with a frames-capable browser.
</p>
</body>
</noframes>
</frameset>

</html>

Example 4
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title>Example 4</title>
</head>

<frameset cols="200,*">
<frame src="menu.html" name="menu">
<frame src="http://www.google.com" name="search">
</frameset>
<body>
<p>
Sorry, this document can be viewed only with a frames-capable browser.
</p>
</body>
</noframes>
</frameset>

</html>


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title>Search Engines</title>
</head>
<body>
<h3>Search Engines</h3>
<ul>
<li><a href="http://www.google.com" target="search"> Google</a></li>
<li><a href="http://search.yahoo.com" target="search"> Yahoo</a></li>
<li><a href="http://search.msn.com" target="search">MSN</a></li>
</ul>
</body>
</html>