在html文件引入其它html文件的几种方法
1.IFrame引入,看看下面的代码
<IFRAME NAME="content_frame" width=100% height=40 marginwidth=0 marginheight=0 SRC="import.htm" ></IFRAME>
你会看到一个外部引入的文件,但会发现有一个类似外框的东西将其包围,可使用
<iframe name="content_frame" marginwidth=0 marginheight=0 width=100% height=40 src="import.htm" frameborder=0></iframe>
但你会发现还会有点问题,就是背景色不同,你只要在引入的文件import.htm中使用相同的背景色也可以,但如果你使用
的是IE5.5的话,可以看看这篇关于透明色的文章 如果想引入的文件过长时不出现滚动条的话在import.htm中的body中加
入scroll=no
*缺点:无法做导航跳转,在iframe里面跳转,内容叠加出现
2.<object>方式
<object style="border:0px" type="text/x-scriptlet" data="import.htm" width=100% height=30></object>
object 标签 — 定义一个内嵌的物件(例如:图像, 媒体, 代码 etc)
* 不符合标准网页设计的理念,已经被标准网页设计抛弃.
3.Behavior的download方式
<span id=showImport></span>
<IE:Download ID="oDownload" STYLE="behavior:url(#default#download)" /> <script> function onDownloadDone(downDate){ showImport.innerHTML=downDate } oDownload.startDownload('import.htm’,onDownloadDone) </script>
更多html文件里include文件内容相关文章请关注PHP中文网!
查看更多关于html文件里include文件内容的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did101047