Embed Tag Got Your Validation Down?

If you’ve ever embedded a flash object in a web page and then tried to validate it then you’ve probably discovered that it doesn’t validate. Why? Because, for some bizarre reason the W3C doesn’t recognize the <embed> tag, the one most often used to run flash movies on the web, as valid HTML. Grrr …

Until recently I thought that that was just my tough luck – that there was nothing to be done about it other than put up with it. I also thought that most folks nerdy enough to validate my sites would also be nerdy enough to know that that it’s not my fault if a page doesn’t validate simply because of the <embed> tag. Apparently, however, I was wrong on both counts.

After recently launching Deluxe Digital Media I had the great privilege of seeing my design show up on several of the showcase sites. This was a totally cool compliment, but greater exposure to the CSS crowd is a double-edged sword … we began to receive emails saying things such as, “I came to your site through CSS Mania. Shame on you for not validating!” Ugh.

So, with renewed inspiration to find a solution I hit the web and happily discovered this article from A List Apart. It’s kinda lengthy, but the jist of it seems to be this:

  • Remove the <embed> tag altogether
  • Remove the “clsid” and the “codebase” attributes within the <object> tag
  • Add the “data” and “type” attributes to the <object> tag
  • Include the <param> tag, as illustrated below

<object width="400" height="400" type="application/x-shockwave-flash" data="your_flash_movie.swf">
<param value="your_flash_movie.swf" name="movie" /></object>

That should do it. I tried it myself and it seemed to work in all the major browsers. Good luck!

2 Responses to “Embed Tag Got Your Validation Down?”