如何去测试HTML5的标准?
twocode

    相信大家都知道,如何去一眼识别是否是HTML5标准的HTML文件,那就是去看源代码中的DTD!

    如果是,说明就是HTML5标准的HTML代码。但是HTML5是新技术,有些标准自己还是不能完全掌握,所以在编写的时候难免会出现纰漏,所以完成后需要找个人检测一下,这里推荐使用网址:    validator.w3.org!

    此网站提供三种检测方式:输入url、上传文件和粘贴源代码,就可以根据返回的错误报告去改编码了。

    在检测的时候,遇到了错误:

    A meta element with an http-equiv attribute whose value is X-UA-Compatible must have a content attribute with the value IE=edge.

    经查询,在stackoverflow.com上是这样说的:

    HTML5:                         The page will validate using the W3 Validator only when using . For other values it will throw the error: A meta element with an http-equiv attribute whose value is X-UA-Compatible must have a content attribute with the value IE=edge. In other words, if you have IE=edge,chrome=1 it will not validate. I ignore this error completely as modern browsers simply ignore this line of code.         If you must have completely valid code then consider doing this on the server level. See olibre'sanswer or bitinn's answer for more details on how to do this.

    大体意思就是说,在HTML5标准下,只识别IE=edge,其他的都会报上面的错误。

    那么IE=EDGE代表什么意思呢?

     就是通知 Windows Internet Explorer 以最高级别的可用模式显示内容,这实际上破坏了“锁定”模式。即如果你有IE789,那么就调用高版本的那个兼容,也就是IE9。

  再次检测:http://www.pekingpiao.com 结果显示如图:

    

1429228212504435.png

 

网友评论已关闭