Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<embed> tag in HTML not supported

I get the following warning in a ASP.NET project using the <embed> tag to put a .swf:

Warning: Validation (XHTML 1.0 Transitional): Element 'embed' is not supported.

What is the "supported" way to do it instead???

like image 478
Carlos Muñoz Avatar asked Dec 04 '22 14:12

Carlos Muñoz


1 Answers

The non-standard embed tag is not supported in XHTML in favour of the standards based object element. See http://www.bernzilla.com/item.php?id=681 for more information on this, but in a nutshell:

<object type="application/x-shockwave-flash" data="c.swf?path=movie.swf" width="400" height="300">
    <param name="movie" value="c.swf?path=movie.swf" />
    <img src="noflash.gif" width="200" height="100" alt="No Flash" />
</object>

Keep in mind though that using object doesn't always work correctly in older browsers, so do a bit of testing using both formats first. A List Apart has a brilliant article on this called "Flash Satay: Embedding Flash While Supporting Standards" which shows you the cross browser way of implementing it as shown in the example above.

like image 57
Nathan Kleyn Avatar answered Dec 30 '22 19:12

Nathan Kleyn