Embed YouTube Videos with XHTML Strict Code

Handwritten by TVD

In my last post on Ferris Club I used a typical YouTube video. But, I bet you didn’t know that little morsel of code was XHTML 1.0 Strict compliant!

XHTML Strict 1.0 or Bust

The Code

The default YouTube code is ugly and dangerous to puppies. Strip away all the baggage until you have this:

<object type="application/x-shockwave-flash" width="520" height="350" data="http://www.youtube.com/v/owGykVbfgUE&amp;hl=en_US&amp;fs=1?rel=0"></object>

Modify the width and height to your taste, then replace the data url with your YouTube video of choice. Rinse. Repeat and enjoy! See, XHTML 1.0 Strict can be social and sexy.

So you know it actually works, here is the embedded YouTube video from the example we reviewed. Without further ado, here is Isaiah Mustafa aka The Old Spice Guy in The Man Your Man Could Smell Like:

The History

For those of you that didn’t know, the < embed /> tag has been deprecated since XHTML 1.0. In other words, fire it faster than Omarosa!

Look down. Look up. I’m on a horse.

discuss on twitter

every day thousands of developers use our charts & gauges to get the job done right

JavaScript Charts JavaScript Gauges JavaScript Flight Gauges

← return to all articles