开发者

Google doesn't follow W3C standards... whaaa? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and poss开发者_开发问答ibly reopened, visit the help center for guidance. Closed 11 years ago.

A friend of mine just pointed out an interesting phenomenon... I went to the Google home page and looked at the source code:

<!doctype html><html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>Google</title>
...
...
...
A LOT OF STUFF HERE
...
...
...
</script>

... so I noticed that source code doesn't have the closing </body> and </html> tags. Using Chrome's Inspector, it shows the closing tags but when I right click and look at the source, its not there.

What is going on here? Am I missing something? I tried using the W3C HTML Validator and it showed a bunch of errors...

http://validator.w3.org/check?verbose=1&uri=http://www.google.com/

So... what's the deal?


Google has a semi-official answer as a youtube video.

Basically when considering they're handling hundreds of millions of requests, they try to minimise the number of bytes sent per request. It's a tradeoff between validation, size and compatibility with different browsers used across the web.


No real-world browser actually rejects invalid HTML. Google is more concerned about supporting lots of different browsers, and optimising their home page down to the byte level. Whether they are right to be so pedantic about optimisation, I don't know, but they sure do serve a lot of pages.


See some answers here Is it necessary to write HEAD, BODY and HTML tags?

W3C Validation says it's valid. From html 4. Also In HTML5, there are no "required" or "optional" elements exactly, as HTML5 syntax is more loosely defined.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜