html 框架

通过使用框架,你可以在同一个浏览器窗口中显示不止一个页面。

本例演示:如何使用三份不同的文档制作一个垂直框架。

<html>

<frameset cols="25%,50%,25%">

  <frame src="/example/html/frame_a.html">
  <frame src="/example/html/frame_b.html">
  <frame src="/example/html/frame_c.html">

</frameset>

</html>

 

本例演示:如何使用三份不同的文档制作一个水平框架。

<html>

<frameset rows="25%,50%,25%">

  <frame src="/example/html/frame_a.html">
  <frame src="/example/html/frame_b.html">
  <frame src="/example/html/frame_c.html">

</frameset>

</html>

框架

通过使用框架,你可以在同一个浏览器窗口中显示不止一个页面。每份HTML文档称为一个框架,并且每个框架都独立于其他的框架。

使用框架的坏处

  • 开发人员必须同时跟踪更多的HTML文档
  • 很难打印整张页面

框架标签(Frame)

Frame 标签定义了放置在每个框架中的 HTML 文档。

在下面的这个例子中,我们设置了一个两列的框架集。第一列被设置为占据浏览器窗口的 25%。第二列被设置为占据浏览器窗口的 75%。HTML 文档 "frame_a.htm" 被置于第一个列中,而 HTML 文档 "frame_b.htm" 被置于第二个列中:

<frameset cols="25%,75%">
   <frame src="frame_a.html">
   <frame src="frame_b.html">
</frameset>

重要提示:不能将 <body></body> 标签与 <frameset></frameset> 标签同时使用!

不过,假如你添加包含一段文本的 <noframes> 标签,就必须将这段文字嵌套于 <body></body> 标签内。

混合框架结构

本例演示如何制作含有三份文档的框架结构,同时将他们混合置于行和列之中。

<html>

<frameset rows="50%,50%">

<frame src="/example/html/frame_a.html">

<frameset cols="25%,75%">
<frame src="/example/html/frame_b.html">
<frame src="/example/html/frame_c.html">
</frameset>

</frameset>

</html>

 

posted @ 2016-05-26 20:45  万里冰封  阅读(298)  评论(0编辑  收藏  举报