iframe 使用

iframe 元素会创建包括另外一个文档的内联框架(即行内框架)。

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<
	</head>
	<body>
		<。--iframe在页面中的送点击 c.html 在iframe中显示  首先给 iframe 定义一个 name  
		将每一个跳转页面中的  a 标签中加入 target 目标等于iframe name就可以 -->
		<ul
			<li> <a  href="b.html" target="iframe">bbbbb</a></li>
			<li> <a  href="c.html" target="iframe">ccc</a></li>
			<li> <a  href="d.html" target="iframe">dddd</a></li>
		</ul>
		<iframe name="iframe"   frameborder=0 width=170 height=100 marginheight=0 marginwidth=0 scrolling=no src="a.html">
		</iframe> 
	</body>
</html>

属性 描写叙述
align
  • left
  • right
  • top
  • middle
  • bottom

不赞成使用。请使用样式取代。

规定怎样依据周围的元素来对齐此框架。

frameborder
  • 1
  • 0
规定是否显示框架周围的边框。

height
  • pixels
  • %
规定 iframe 的高度。
longdesc URL 规定一个页面,该页面包括了有关 iframe 的较长描写叙述。

marginheight pixels 定义 iframe 的顶部和底部的边距。
marginwidth pixels 定义 iframe 的左側和右側的边距。
name frame_name 规定 iframe 的名称。

sandbox
  • ""
  • allow-forms
  • allow-same-origin
  • allow-scripts
  • allow-top-navigation
启用一系列对 <iframe> 中内容的额外限制。
scrolling
  • yes
  • no
  • auto
规定是否在 iframe 中显示滚动栏。
seamless seamless 规定 <iframe> 看上去像是包括文档的一部分。

src URL 规定在 iframe 中显示的文档的 URL。

srcdoc HTML_code 规定在 <iframe> 中显示的页面的 HTML 内容。
width
  • pixels
  • %
定义 iframe 的宽度。

posted on 2017-05-13 11:37  yjbjingcha  阅读(123)  评论(0编辑  收藏  举报

导航