Markup after the HTML tag

From time to time when a web page renders strangely I’ll take a quick peak at the HTML source to see what kinds of extra scripts and remotely hosted resources are part of the page. The usual stuff (Google Analytics, Flickr Slideshows, Banner Ads, Facebook, Twitter, etc) never stands out to me, but today I saw something that made me take notice.

The snippet below is the last few lines of a page on a major newspaper’s website. Now, for the record, I’m only 99.9% certain that this markup is broken:

</html><img width='0' height='0' border='0' src='/counter?uid=123'/>

Maybe this kind of markup after the closing HTML tag is not an issue in any browser. Maybe. I would be interested to know if the placement of the “counter” image is on purpose or just a temporary quirk of the publishing system. I can’t think of any reason to not put a dimensionless tracking image inside the closing body tag — especially when it’s being requested from the same host as the document.

Please chime in with a comment if I’m missing something here.