Sla*_*ast 10 xhtml firefox doctype
由于我学会了以XML格式提供XHTML页面,我开始注意到一些奇怪的事情:每当我在Firefox源代码查看器中查看XHTML页面时,DOCTYPE 总是被标记为错误.根据我从鼠标上面得到的工具提示,有问题的错误是"流浪的doctype".根据我的理解,"流浪的doctype"意味着在文档的中间有一个额外的DOCTYPE,它不属于这种情况,这肯定不是这里的情况.
这是一个示例 - 此标记将通过验证,并在所有现代浏览器中正确显示:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--FF source viewer will mark the preceding two lines as an error.-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="content-type"
content="application/xhtml+xml; charset=utf-8" />
<title>Sample XHTML Page</title>
</head>
<body>
<p>This is an example.</p>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
考虑到这些页面完美地通过验证,并且单个解析错误通常会破坏页面,此错误消息尤其奇怪.
| 归档时间: |
|
| 查看次数: |
4900 次 |
| 最近记录: |