我正在尝试将一个 html 文件包含在另一个 html 文件中。 include 充当菜单和页脚。我正在使用当前的 include 语法,但我的 html 数据没有显示在页面上。我的包含文件位于根目录。我试过了:
<!--#include virtual="header.html" -->
<!--#include file="navigation.html"-->
<html>
<head>
<title>test</title>
</head>
<body>
<!--#include virtual="header.html" -->
<!--#include virtual="navigation.html"-->
<p>test<p>
<!--#include virtual="footer.html"-->
</body>
</html>
最佳答案
检查您的服务器是否启用了服务器端包含 (SSI)。
编辑:此外,您应该删除 html
标记之前的第一组包含 - 这是无效的。
关于html - 在 html 文件中包含 html 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4874084/