Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
html5验证错误输出_Html_Validation_Markup - Fatal编程技术网

html5验证错误输出

html5验证错误输出,html,validation,markup,Html,Validation,Markup,我已经尝试验证我的html5文档,尽管我得到了一些无效的标记错误 我的代码如下: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]--> <!--[if IE 7 ]><html class="ie ie7"

我已经尝试验证我的html5文档,尽管我得到了一些无效的标记错误

我的代码如下:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html>
    <!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
    <!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
    <!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
    <!--[if (gte IE 9)|!(IE)]><!-->
    <html lang="en">
    <!--<![endif]-->
    <head>
    <meta charset="utf-8">
    <title>index</title>
    <meta name="description" content=""/>
    <link rel="stylesheet" href="assets/css/base.css">
    <script type="text/javascript" src="assets/js/jquery-1.6.1.min.js"></script>
    <script type="text/javascript" src="assets/js/jquery-ui-1.8.16.custom.min.js"></script>
    </head>

指数
错误是:

    Line 7, Column 16: application/xhtml+xml is not an appropriate Content-Type for a document whose root element is not in a namespace. **<html lang="en">**

    Line 7, Column 16: Unnamespaced element html not allowed in this context. (Suppressing further errors from this subtree.) **<html lang="en">**

    Line 16, Column 3: required character (found h) (expected l) **</head>**
第7行第16列:对于根元素不在命名空间中的文档,application/xhtml+xml不是合适的内容类型****
第7行第16列:此上下文中不允许使用未命名的元素html。(正在抑制来自此子树的进一步错误。)****
第16行第3列:所需字符(h)(预期为l)****
如有专家建议,将不胜感激

谢谢,,
Patrick

HTML5是HTML而不是XHTML(XML),因此
会导致验证问题(正如Aaron已经说过的)

只需将XHTML名称空间添加到HTML元素中,如下所示:


您的代码仍然无效,因为您忘了向无效元素(meta和link)添加额外的反斜杠。

删除
,它应该进行验证。这很快-感谢Aaron-它成功了!