编程笔记

编程笔记

HTML5中的iframe标签
2025-01-29

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

src:src 属性规定在 iframe 中显示的文档的 URL;

name:设置该iframe的名字;

scrolling:scrolling属性规定是否在 iframe 中显示滚动条;

frameborder:frameborder属性规定是否显示 iframe 周围的边框;

srcdoc:srcdoc 属性规定页面的 HTML 内容显示在行内框架中;

sandbox:sandbox属性将会启用一系列对行内框架中内容的额外限制。

 

<!DOCTYPE html>
<html>
	<head>
		<title></title>
		<meta charset="utf-8">
		<style type="text/css">
			.frame_left{
				width:30%;
				height:500px;
				float:left;
				border:1px solid #000;
			}
			.frame_right{
				width:60%;
				height:500px;
				float:left;
				margin-left:3%;
				border:1px solid #000;
			}
		</style>
	</head>
	<body>
		<div class="frame_left">
			
			<div><a href="https://www.taobao.com" target="demo"  >淘宝</a></div>
			<div><a href="https://www.baidu.com"  target="demo"  >百度</a></div>
			
		</div>
		<div class="frame_right">
			<iframe  src="http://baidu.com"  name="demo" height="500" width="100%	" frameborder=0 ></iframe>
		</div>
	</body>
</html>