<a href="http://blog.51cto.com/attachment/201207/162907888.png" target="_blank"></a>
2.框架的基本结构:
<a href="http://blog.51cto.com/attachment/201207/163035312.png" target="_blank"></a>
注意事项:1.框架网页是没有body的!!!!
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=GBK" />
<title>框架网页-cols</title>
</head>
<frameset rows="80,*" border="5">
<frame name="top" src="top.html"/>
<frameset cols="400,*">
<frame name="left" src="http://www.baidu.com"/>
<frame name="right" src="http://www.google.com.hk"/>
</frameset>
</frameset>
</html>
注意事项:如果你想让框架网页之间的边框消失,要在frame标签中加上frameborder="0"这个属性!!
如果你不想框架网页之间的边框可以被随意拖动,那么你需要再frame标签中加上noresize="noresize"这个属性!
eg.
<frame name="top" src="http://www.sina.com" frameborder="0"/>
<frame name="left" src="http://www.baidu.com" frameborder="0"/>
<frame name="right" src="http://www.w3school.com.cn/" frameborder="0" noresize="noresize"/>
3.框架网页中的超链接:
<a href="http://blog.51cto.com/attachment/201207/165253557.png" target="_blank"></a>
target="blank" → 新窗口
target="parent" → 父窗口
target="right" → 去框架中的某个name="right"的窗口。当然,还可以有left,top等。
3.当你想在普通网页中引入其他的网页时,可以用iframe这个标签!
用法:
<html xmlns="http://www.w3.org/1999/xhtml">
<title>iframe</title>
<body>
<iframe src="http://www.baidu.com" frameborder="2" width="200" height="200" scrolling="no"/>
它的一些属性:
<a href="http://blog.51cto.com/attachment/201207/171013110.png" target="_blank"></a>
本文转自韩立伟 51CTO博客,原文链接:http://blog.51cto.com/hanchaohan/927271,如需转载请自行联系原作者