Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Benefits of omitting closing body and html tags?

Are there any benefits to omitting the closing body and html tags?

Why is the google.com homepage missing the closing body and html tags?

  • edit - with regards to bandwidth, it's an extremely small amount, really. Say 10 million hits @ roughly 10 bytes saved ~ 100 mb only... Are there reasons other than bandwidth?

  • edit 2 - and nope, google (yahoo, microsoft, and others) are not w3-validator compliant... when it comes to bandwidth-saving en mass vs w3-compliance, I guess the latter's good for the sacrificing?

like image 822
ina Avatar asked Jul 21 '10 09:07

ina


People also ask

Is it necessary to close body tag in HTML?

In HTML 5 it is not mandatory to include a <body> tag inside the HTML document but in previous versions(4.0. 1) it was mandatory to include it. The tags like <div>, <p> or <a> which are generally contained inside body will also work fine without the <body> tag or outside the <body> tag.

What happens if we don't close HTML tag?

Not closing tags can lead to browser incompatibilities and improperly rendered pages. That alone should be enough reason to properly close your tags.

Why is it important to use closing tags?

Should Optional HTML Tags be Closed? Code with closing tags is much more readable and easy to follow. It is much easier to visually inspect a page with well laid out markup. Working with this markup is easier for developers.


1 Answers

Think of how many times that page is served every day. Even small reductions in size can be significant at that volume of traffic.

(Although I work for Google, please don't treat this as an "official answer from Google" - it's a guess, but an educated one.)

like image 72
Jon Skeet Avatar answered Sep 19 '22 11:09

Jon Skeet