html调用

来源:百度知道 编辑:UC知道 时间:2024/05/31 08:49:36
我在建网站,首页做好了,做分页想调用首页的头部,帮帮忙,举例子,详细教小弟一下!

1.IFrame
这个可能是最熟悉的
<iframe name="neepage" marginwidth="0" marginheight="0" src="头部页面.html" width="100%" height="30"></iframe>
加上它的一些属性可以实现一些透明,无滚动条等具体的效果.可以看下html教程的相关介绍

2.Frameset
框架,没什么好说的,看看html教程就行

3.<object type="text/x-scriptlet" data="头部页面.html" width=100% height=30></object>

不用框架,用<!--#include file="调用文件名" -->也可以实现。
你可以把首页的头部拷贝出来,单独做个页面取名为top.html,然后在每个要用的页面用<!--#include file="top.html" -->调用就行了。

<link rel="stylesheet" href="css/头部公共.css" type="text/css" />
<link rel="stylesheet" href="css/非公共.css" type="text/css" />

HTML非要这样的话,就只能将头部单独出来做成一下HTML页面,再用FRAME将这个页面框进来了.