YouTube Embed Code is not W3C Compliant
I was recently making one of my websites compliant when I became aware that the basic code that YouTube provides users is not compliant with the global XHTML standards - meaning that my site was not fully user-friendly while it was on there.
It turns out that the W3C Validator isn’t keen on <embed> tags appearing anywhere on the page, so I did a bit of research and cam across the following replacement code which works and is completely compliant with the standards:
<object type=”application/x-shockwave-flash” width=”425″ height=”350″ data=”http://www.youtube.com/v/yourcode“><param name=”movie” value=”http://www.youtube.com/v/yourcode” /></object>
The parts where it says your code need to be replaced with the extension that applies to the location of your YouTube video - this is present in the orginal embed code and can be just copied and pasted across.



