<frameset cols = "25%, 25%,*">
<noframes>
<body>Your browser does not handle frames!</body>
</noframes>
<frame src ="venus.htm" />
<frame src ="sun.htm" />
<frame src ="mercur.htm" />
</frameset>
<frameset cols="25%,50%,25%">
<frame src="frame_a.htm" /> <frame src="frame_b.htm" /> <frame src="frame_c.htm" /></frameset>
属性 | 值 | 描述 |
---|---|---|
cols |
| 定义框架集中列的数目和尺寸。有关 cols 属性的详细信息。 |
rows |
| 定义框架集中行的数目和尺寸。有关 rows 属性的详细信息。 |
<frame> 标签定义 frameset 中的一个特定的窗口(框架)
重要事项:您不能与 <frameset></frameset> 标签一起使用 <body></body> 标签。不过,如果您需要为不支持框架的浏览器添加一个 <noframes> 标签,请务必将此标签放置在 <body></body> 标签中!
可选的属性
属性 | 值 | 描述 |
---|---|---|
frameborder |
| 规定是否显示框架周围的边框。 |
longdesc | URL | 规定一个包含有关框架内容的长描述的页面。 |
marginheight | pixels | 定义框架的上方和下方的边距。 |
marginwidth | pixels | 定义框架的左侧和右侧的边距。 |
name | name | 规定框架的名称。 |
noresize | noresize | 规定无法调整框架的大小。 |
scrolling |
| 规定是否在框架中显示滚动条。 |
src | URL | 规定在框架中显示的文档的 URL。 |
<frame src="/example/html/frame_a.html">
<frame src="/example/html/frame_b.html">
<frame src="/example/html/frame_c.html">
</frameset>
与iframe的区别
iframe属性
属性 | 值 | 描述 | DTD |
---|---|---|---|
align |
| 规定如何根据周围的文本来排列此框架。 | TF |
frameborder |
| 规定是否显示框架的边框。 | TF |
height |
| 定义 iframe 的高度。 | TF |
longdesc | URL | 描述此框架内容的长描述的URL。 | TF |
marginheight | pixels | 定义 iframe 的顶部和底部的边距。 | TF |
marginwidth | pixels | 定义 iframe 的左侧和右侧的边距。 | TF |
name | frame_name | 规定 iframe 的唯一名称 (以便在脚本中使用)。 | TF |
scrolling |
| 定义滚动条。 | TF |
src | URL | 在 iframe 中显示文档的 URL。 | TF |
width |
| 定义 iframe 的宽度。 | TF |
示例代码: