Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/368.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
为什么谷歌让html标签打开?_Html - Fatal编程技术网

为什么谷歌让html标签打开?

为什么谷歌让html标签打开?,html,Html,在Google的404页面中,html标记没有结束标记。 您可以通过导航到www.googleusercontent.com查看代码 这不会在w3c验证程序上生成任何错误。为什么呢 <!DOCTYPE html> <html lang=en> <meta charset=utf-8> <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width"

在Google的404页面中,html标记没有结束标记。 您可以通过导航到www.googleusercontent.com查看代码 这不会在w3c验证程序上生成任何错误。为什么呢

<!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 404 (Not Found)!!1</title>
  <style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}
  </style>
  <a href=//www.google.com/><img src=//www.google.com/images/errors/logo_sm.gif alt=Google></a>
  <p><b>404.</b> <ins>That’s an error.</ins>
  <p>The requested URL <code>/</code> was not found on this server.  <ins>That’s all we know.</ins>

这应该有助于解释:

根据谷歌最新的加速网络的指导方针,有 HTML4中的许多可选标记可以省略以节省速度, 即使这让你作为一个开发者感到有点不舒服。(谷歌是 快速指出这些技巧是针对HTML而不是XHTML的。)

谷歌主页和搜索结果页面不会结束它们的
元素。他们只是让它们敞开着——就像一个懒汉 开发人员可能会这样做,当他回来看到时会感到内疚 这个错误

只有这一“错误”才是谷歌治疗癌症战略的一部分 他们的表现是一种竞争优势。所有浏览器都工作正常 没有标签,标签占用时间,所以他们很兴奋 为访问者消除任何毫秒

来自:

如果html元素不存在,则可以省略html元素的结束标记 紧接着是注释,元素包含一个主体 元素,该元素不是空的或其开始标记尚未被删除 省略

:

仅在HTML语法中,开始标记和结束标记都是可选的,因此为了方便起见,可以省略这两个标记,除非您希望在此元素上指定属性,在这种情况下,至少需要包含开始标记