1

每次更新标题时,我都会进入并单独更新每个页面。我很确定有一种方法可以将标题保存在一个文件中,然后在每个页面中调用它。

这样我更新了一个文件,它会在每一页上自动更新。我是这一切的新手,所以请保持简单易懂:)

4

3 回答 3

0

使用seamless属性,您的iframe标签看起来像是文档的一部分:

<iframe src="header.htm" seamless="seamless"></iframe>

或者

<iframe src="header.htm" seamless></iframe>

请注意浏览器支持!

于 2012-09-20T06:38:26.087 回答
0

如果您的网络主机支持 php,这很容易做到。

首先创建您的 header.php 文件并将所有文本、按钮等插入到 header.php 文件中。

其次创建一个footer.php 文件并在footer.php 文件中插入所有文本、按钮等。

然后创建一个 index.php 并像这样调用包含文件。

<div><?php include 'header.php'; ?></div>
<div>Sone Content</div>
<div><?php include 'footer.php'; ?></div>

然后对于其他页面遵循相同的指导方针。为了使它工作,您的所有文件都需要具有 .php 扩展名。

于 2012-09-19T18:17:59.547 回答
0

You don't say which server you are using to host the files - but most of them have the ability to do server-side includes. This would let you put your header into a separate file, and 'include' it in each html file. When the HTML file is requested, the server would replace the include statement with the contents of the header file.

Check your server documentation for more details

于 2012-09-19T15:16:44.643 回答