在使用ESI(包含边的边)的文件中,esi:include
个元素从head
移到body
。如果将esi:include
更改为foo
或任何其他非标准HTML元素,也会发生相同的事情:
之前:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex, nofollow">
<esi:include src="/head.html"></esi:include>
<title>Test</title>
</head>
<body>
<h1>Test</h1>
</body>
</html>
之后:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex, nofollow">
<title>Test</title>
</head>
<body>
<esi:include src="/head.html"></esi:include>
<h1>Test</h1>
</body>
</html>
这是故意的吗?我可以防止它发生吗?
答案 0 :(得分:0)
根据https://www.w3.org/MarkUp/html3/dochead.html和https://developer.mozilla.org/en-US/docs/Web/HTML/Element/head#See_also,以下元素对
有效: