Google and Amazon Generates Invalid HTML
More HTML validation Pain.
Here's a amazon ad widget from Amazon Associate site:
<iframe src="http://rcm.amazon.com/e/cm?t=xyzxyz-20&o=1&p=11&l=ur1&category=textbooks&banner=17P1AE8RQ1T7ZFC62V82&f=ifr" width="120" height="600" scrolling="no" border="0" marginwidth="0" style="border:none;" frameborder="0"> </iframe>
Of course it is not valid HTML. The ampersand needs to be
&. Also, there's no
border="0" attribute for “iframe” tag.
Well, Google isn't doing much better. Here's the code given by youtube for embedding a video:
<iframe title="YouTube video player" class="youtube-player" type="text/html" width="640" height="390" src="http://www.youtube.com/embed/nnsSUqgkDwU" frameborder="0" allowFullScreen> </iframe>
“iframe” tag doesn't have the “type” attribute
type="text/html", and there's no such thing as “allowFullScreen”.
How bad can it be? So, from these 2 sites alone, handling out bad code, are directly responsible for millions of site being invalid HTML. Of course, all other video sites all hand out invalid HTML. None gives correct HTML as far as i know. 〔➤see How to Embed Video with Valid HTML〕
<iframe …><!-- allowFullScreen --></iframe>. And am not too sure that
type="text/html" there is really necessary.
Amazingly, Google fixed it! Now the embed code no longer contains