码迷,mamicode.com
首页 > Web开发 > 详细

HTML的内联框架(iframe)

时间:2020-02-16 16:21:59      阅读:256      评论:0      收藏:0      [点我收藏+]

标签:完整   baidu   pre   tps   iframe   tag   frame   hello   ring   

HTML的内联框架(iframe)

第一种:打开网页就是带内联框架的页面

可以实现在自己的网页内部,打开另一个网页

语法:

<!--
src:地址
frameborder:0为无边框;1为有边框
-->
<iframe src="https://www.baidu.com/" frameborder="0" width="800" height="600"></iframe>

 技术图片

完整代码如下:

<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <title>iframe内联框架学习</title>
</head>
<body>
<h1>下面是网页内部打开网页</h1>
<hr/>
<!--
src:地址
frameborder:0为无边框;1为有边框
-->
<iframe src="https://www.baidu.com/" frameborder="0" width="800" height="600"></iframe>
<hr/>
<h1>上面是网页内部打开网页</h1>
</body>
</html>

第二种:打开网页没内联框架的页面,需要点击页面中的跳转链接

 

与之前的点击跳转到指定网站的区别在于,现在是在网页内部打开网站,而不是新标签页打开。

语法:

<a href="https://www.baidu.com/" target="hello" >点击跳转</a>
<hr/>
<iframe src="" name="hello" frameborder="0" width="800" height="600"></iframe>

技术图片

完整代码如下:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>iframe内联框架学习</title>
</head>
<body>
<h1>下面是网页内部打开网页</h1>
<hr/>
<a href="https://www.baidu.com/" target="hello" >点击跳转</a>
<hr/>
<iframe src="" name="hello" frameborder="0" width="800" height="600"></iframe>
<hr/>
<h1>上面是网页内部打开网页</h1>
</body>
</html>

 

HTML的内联框架(iframe)

标签:完整   baidu   pre   tps   iframe   tag   frame   hello   ring   

原文地址:https://www.cnblogs.com/WZ-BeiHang/p/12317115.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!