Author Topic: Embedding YouTube Videos as Valid XHTML 1.0  (Read 1162 times)

Garnel

  • Administrator
  • Gold Member
  • *****
  • Posts: 97
  • I love my friends
    • View Profile
Embedding YouTube Videos as Valid XHTML 1.0
« on: February 21, 2007, 10:19:17 am »
If you\'ve ever validated an otherwise XHTML 1.0 compliant website that embedded a video from YouTube, you\'ve probably seen validation errors related to YouTube\'s use of the <embed> tag, which has been deprecated in XHTML 1.0.

If you\'re looking to embed a YouTube video in your website\'s code and want to retain your validity, instead of using their suggested format:

<object width="425" height="350"><param name="movie" value="http://www.youtube.com......."></param><embed src="http://www.youtube.com......." type="application/x-shockwave-flash" width="425" height="350"></embed></object>

Use the following format:

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

You\'ll notice that the new format leaves out the <embed> tag and still functions correctly when embedded in your web page.

or

<object type="application/x-shockwave-flash" width="425" height="350" data="http://www.youtube.com......."><param name="movie" value="http://www.youtube.com......." /></object>
« Last Edit: February 21, 2007, 10:22:30 am by admin »
Intelligence is like an underwear-we all should have it but we should'nt show it off!!!