frameset应用

main.html 注意不能用body标签

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>main.html</title>
</head>
<frameset rows="50,*">
	<frame src="top.html" />
	<frameset cols="30%,*">
		<frame name="left" src="left.html" />
		<frame name="main" src="right.html" />
	</frameset>
</frameset>
</html>


top.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>top.html</title>
</head>
<body>
	<center>
		<h1>top.html</h1>
	</center>
</body>
</html>


left.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>left.html</title>
</head>
<body>
	<center>
		<h1>left.html</h1>
	</center>
	<a href="http://www.baidu.com" target="main">www.baidu.com</a>
</body>
</html>


right.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>right.html</title>
</head>
<body>
	<center>
		<h1>right.html</h1>
	</center>
</body>
</html>


主要就是在跳转的时候指定frame的name属性target

你可能感兴趣的:(FRAMESET)