When going to YouTube, it gives a embed code such as
<iframe title="YouTube video player"
class="youtube-player" type="text/html" width="640" height="385"
src="http://www.youtube.com/embed/QRvVzaQ6i8A?rel=0">
</iframe>
Note that the
type="text/html"
is not valid html. There's no such attribute for iframe tag.
could anyone explain why google put that? I guess it's for some practical reason, but i couldn't guess what.
PS you can get the embed code by going here http://www.youtube.com/watch?v=QRvVzaQ6i8A
It's not a mistake, it's the embed code for the HTML5 Youtube Player.
When it comes to validating HTML, you have to remember that HTML5 allows the content author to use non-standard elements and attributes and the document should still work. Additionally, non-standard markup that becomes popular enough can be documented and become an extension to the HTML5 spec.
I guess it is a mistake from Google itself. I suspect a mistake. It was not part of HTML4, and it is not part of HTML5. You can safely ignore it and remove it.
on the type attribute topic: The type on the object element is conforming but obsolete. It has never been really used by browsers to guess the content of the URI served.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With