frames 框架与iframe框架

来源:互联网 发布:金蝶eas数据库类型 编辑:程序博客网 时间:2024/05/21 09:01

<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
  • pixels
  • %
  • *
定义框架集中列的数目和尺寸。有关 cols 属性的详细信息。rows
  • pixels
  • %
  • *
定义框架集中行的数目和尺寸。有关 rows 属性的详细信息。

<frame> 标签定义 frameset 中的一个特定的窗口(框架)

重要事项:您不能与 <frameset></frameset> 标签一起使用 <body></body> 标签。不过,如果您需要为不支持框架的浏览器添加一个 <noframes> 标签,请务必将此标签放置在 <body></body> 标签中!

可选的属性

属性值描述frameborder
  • 0
  • 1
规定是否显示框架周围的边框。longdescURL规定一个包含有关框架内容的长描述的页面。marginheightpixels定义框架的上方和下方的边距。marginwidthpixels定义框架的左侧和右侧的边距。namename规定框架的名称。noresizenoresize规定无法调整框架的大小。scrolling
  • yes
  • no
  • auto
规定是否在框架中显示滚动条。srcURL规定在框架中显示的文档的 URL。<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>


与iframe的区别

iframe属性

属性值描述DTDalign
  • left
  • right
  • top
  • middle
  • bottom
规定如何根据周围的文本来排列此框架。TFframeborder
  • 1
  • 0
规定是否显示框架的边框。TFheight
  • pixels
  • %
定义 iframe 的高度。TFlongdescURL描述此框架内容的长描述的URL。TFmarginheightpixels定义 iframe 的顶部和底部的边距。TFmarginwidthpixels定义 iframe 的左侧和右侧的边距。TFnameframe_name规定 iframe 的唯一名称 (以便在脚本中使用)。TFscrolling
  • yes
  • no
  • auto
定义滚动条。TFsrcURL在 iframe 中显示文档的 URL。TFwidth
  • pixels
  • %
定义 iframe 的宽度。TF

示例代码:






0 0