内嵌框架的作用
内嵌框架多用于界面切换等场景,有效的减少了代码使用量,减少了运维工程师对代码维护的困难
实例1.内嵌的基本用法
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<h1>头部</h1>
<!-- target绑定iframe声明的name -->
<a href="http://www.baidu.com" target="demo">内容1</a>
<a href="https://www.jd.com" target="demo">内容2</a>
<a href="https://ai.taobao.com" target="demo">内容3</a>
<br>
<!-- src为默认界面,name和target配合绑定使用 -->
<iframe src="https://www.runoob.com/css/css-dropdowns.html" width="800px" height="500px" name="demo"></iframe>
<br>
<h1>尾部</h1>
</body>
</html>
是不是有小伙伴还想要去除边框呀!很简单的哟!
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<h1>头部</h1>
<!-- target绑定iframe声明的name -->
<a href="http://www.baidu.com" target="demo">内容1</a>
<a href="https://www.jd.com" target="demo">内容2</a>
<a href="https://ai.taobao.com" target="demo">内容3</a>
<br>
<!-- src为默认界面,name和target配合绑定使用 -->
<iframe src="https://www.runoob.com/css/css-dropdowns.html" width="800px" height="500px" name="demo" frameborder="0"></iframe>
<br>
<h1>尾部</h1>
</body>
</html>