HTML and CSS Reference
In-Depth Information
In HTML5, you may find yourself using the <video> tag rather than the <object> tag
for video files, but the <object> tag will still be used for other Flash movies, and for
other multimedia content, such as Microsoft Silverlight.
Alternative Content for the <object> Tag
What happens when a user hasn't installed the plug-in that the <object> tag requires?
The browser will either display an error message or just display nothing at all. However,
you can provide alternative content that will be displayed if the browser cannot find the
correct plug-in. All you have to do is include the alternative content inside the <object>
tag. If the <object> tag works, it will be ignored. If it doesn't, it will be displayed. Here
are the nested <object> tags with some alternative content included. You can see alterna-
tive content displayed in a browser that does not have Flash installed in Figure 12.11.
Here's the code:
<object classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000” width=”780”
height=”420”>
<param name=”movie” value=”movie.swf” />
<object type=”application/x-shockwave-flash” data=”myContent.swf” width=”780”
height=”420”>
<p> You need the Flash player to view this page.
<a href=”http://get.adobe.com/flashplayer/> Get Flash. </a></p>
</object>
</object>
FIGURE 12.11
Alternative content
displayed in a
browser that
doesn't support
Flash.
TIP
It's often a good idea to make your alternative content the same
size as the <object> tag to preserve the layout of your page. You
can style your alternative content with CSS or use an image of the
same size as a placeholder for the <object> .
 
Search WWH ::




Custom Search