target=_parent时为什么不在父框架集打开网页?

长源Gingko 2015-05-24 01:21:23
大家好!以下是《HTML+CSS网页设计与布局从入门到精通》中的一个例子,我稍做了些改动,代码如下:
index.htm:
<html>
<head>
<title>test</title>
</head>
<frameset rows="210,*">
<frameset cols="410,*">
<frame src="04-07.htm">
<frame>
</frameset>
<frame src="04-08-01.htm" name="main">
</frameset>
</html>

04-07.htm:
<html>
<head>
<title>图像热区</title>
</head>
<body style="margin:0">
<img src="navi.jpg" width="400" height="200" border="0" usemap="#Map">
<map name="Map">
<area shape="rect" coords="303,22,377,52" href="04-08-01.htm" target="_parent">
<area shape="rect" coords="242,76,321,105" href="04-08-02.htm" target="_parent">
<area shape="rect" coords="141,126,216,157" href="04-08-03.htm" target="_parent">
<area shape="rect" coords="15,152,92,183" href="04-08-04.htm" target="_parent">
</map>
</body>
</html>
这里的热区即公司介绍、产品分类、售前服务、技术支持(见下图)四个位置。

04-08-01.htm:
<!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" />
<title>无标题文档</title>
</head>
<body>
<p>这是<strong>公司介绍</strong>页面 </p>
<iframe width=700 height=2000 src=http://www.artech.com > </iframe>
</body>
</html>

04-08-02.htm:
<!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" />
<title>无标题文档</title>
</head>
<body>
这是<strong>产品分类</strong>页面
</body>
</html>

04-08-03.htm:
<!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" />
<title>无标题文档</title>
</head>
<body>
这是<strong>售前服务</strong>页面
</body>
</html>

04-08-04.htm:
<!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" />
<title>无标题文档</title>
</head>
<body>
这是<strong>技术支持</strong>页面
</body>
</html>

index的显示效果如图:

在04-07.htm中,target="_parent",说明应该在frame的父框架集中打开网页,即在
<frameset cols="410,*">
<frame src="04-07.htm">
<frame>
</frameset>
即在

中打开新页面
但是实际的运行效果却是在本网页中打开新页面,如图:


这相当于target=_top了,请问这是为什么啊?


...全文
195 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
香蕉猪 2015-05-28
  • 打赏
  • 举报
回复
楼主想要的效果应该是target="_self",,,不是_parent.

61,111

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧