如何在html文件中包含其他html文件

如何在html文件中包含其他html文件,第1张

IFrame

框架的形式

<iframe name="toppage" width=100% height=30 marginwidth=0 marginheight=0 src="top.htm" ></iframe>

iframe也称作嵌入式框架,嵌入式框架和框架网页类似,它可以把一个网页的框架和内容嵌入在现有的网页中。它与<frame>不同的是,iframe可以嵌在网页中的任意部分。

属性:name="..."定义的名字

 scr="..."定义显示的内容的来源

 frameborder="..."定义边界(0或1)

 margwidth="..."设置边界和其中内容之间的宽间距

 margheight="..."设置边界和其中内容之间的高间距

 align="..."控制对齐方式(left, center, right, justify)

 noresize="..."使帧的尺寸不能变

 scrolling="..."设置滚动条的表示方式(auto, yes, no)

 height="..."高度

 width="..."宽度

                               allowtransparency="true"是否允许透明

2.<object>

<object type="text/x-scriptlet" data="top.htm" width=100% height=30></object>

<object id=editBox data="http://evil.2ec.cn/" width="100%" height=500 type=text/x-scriptlet>

1、HTML引用方法:

<iframe name="toppage" width=100% height=100%

marginwidth=0 marginheight=0 frameborder="no" border="0"

src="index.html" ></iframe>

2、JS引用方法:

<object style="border:0px" type="text/x-scriptlet" data="index.html" width=100% height=100%></object>

3、<script type="text/javascript" src="index.js"></script

利用<iframe></iframe>来 *** 作,如有A,B两个文件,现将A插入到B页面, *** 作如下:

在B页面的<body></body>的开头或者结尾写入<iframe src="a.html"></iframe>,具体位置按照自己的需求来写即可;

如:

<html>

<head></head>

<body>

这是B页面

<iframe src="a.html">这是A</iframe>

</body>

</html>


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/tougao/12033453.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-20
下一篇 2023-05-20

发表评论

登录后才能评论

评论列表(0条)

保存