Youtube code-snippet for embedding video not XHTML compliant.

According to the W3C Markup Validation Service the snippet suggested by youtube to embed video isn’t valid XHTML 1.0 Transitional. Google to the rescue! A quick search revealed the following compliant alternative:

<div style="text-align:center">
  <object type="application/x-shockwave-flash" style="width:425px; height:350px"
data="http://www.youtube.com/v/VIDEO_ID">
    <param name="movie" value="http://www.youtube.com/v/VIDEO_ID">
    </param>
  </object>
</div>

(Source: http://www.wildbits.de/2006/04/02/youtube-xhtml/)

One Response to “Youtube code-snippet for embedding video not XHTML compliant.”

  1. Eduard vom Steinhof Says:

    Hi!

    This is quite a useful code-snippet but do you know something that is also XHTML valid?

    We also have a WP-blog and maybe we would like to implement videos in the future, too.

    http://www.neue-havanna-zeitung.de

Leave a Reply