An overflowing bathtub of creative stuff.

Feb 3

How to embed YouTube content using valid XHTML

Add

It seems that the good folks at YouTube have seen fit to wrap their player in invalid markup. Yes that’s right, the code you copy from YouTube to embed clips will invalidate your site. If you want to post Youtube content and remain valid, you can do so by doing something like this:
<object type="application/x-shockwave-flash" style="width:450px; height:366px;" data="http://www.youtube.com/v/hTPkCSvGhV0">
<param name="movie" value="http://www.youtube.com/v/hTPkCSvGhV0" />
</object>

Posted by: Ian Alexander Wood

One Response to “How to embed YouTube content using valid XHTML”

  1. Ravi Abbott says:

    This is so useful i am using it all the time. Ideal for word press.

Leave a Reply

(required)

(required but will not be published)


(required)

category

tag cloud

twitter

Tweets from:
Ian Alexander Wood

Tweets from:
Andy Hicks

Tweets from:
Ravi Abbott

archives