English 中文(简体)
如何在 html 中包含 html 文件
原标题:How to include an html file within html
  • 时间:2012-05-24 13:03:31
  •  标签:
  • html

我试图在我的索引.htm档案中放一个foter.htm,但我目前还不能。这是我的代码。

索引.htm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<p>This is my index page!</p>
<!--#include virtual="feoter.htm 脚脚.htm" -->

<!--#include file="feoter.htm 脚脚.htm" -->

</body>
</html>

feoter.htm 脚脚.htm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<p>This is my footer</p>
</body>
</html>

我在2010年的视觉工作室里尝试过, 在网络服务器上也尝试过, 我也尝试过Apache, 但毫无运气。

问题回答

您正在使用 < a href=" "http://bignosebird.com/ssi.shtml" rel="nofollow" > server 侧面, 包括 语法。 您需要配置您的网络服务器来处理您的 HTML 文档用于 SSI 指令 。

在阿帕奇手册中有一个 < a href=> "http://http://httpd.apache.org/docs/2.0/howto/ssi.html" rel= "nofollow" > 指南,用于配置 SSI 。

这个语法对SSI来说是正确的 也许你应该检查一下:

That SSIs are supported on your webhost That the filename is correct (i.e. htm and not html.)





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签