Images aren't the only things that can be displayed as part of a web page. You can also include content such as Quicktime movies, interactive Flash files, all manner of Java applets, and more. The browser renders embedded media files using the provided code (as in the case of an applet), using its built-in display devices (as for GIF or JPEG images), or by taking advantage of a plug-in or helper application.
The three tags that embed media in HTML are <object> (the HTML 4.01 preference for all media), <applet> (for Java applets; deprecated in HTML 4.01), and <embed> (for plug-in dependent media; not even recognized in HTML 4.01). Following are overviews of each of these tags and their uses.
The <object> Tag
The <object> tag is an all-purpose object-placer. It can be used to place a variety of object types on a web page, including applets (Java or ActiveX), multimedia objects, and even plain old images.
It began as a proprietary tag in Internet Explorer to support ActiveX and later Java applets. Netscape Navigator initially supported only <embed> and <applet> for embedding media, but added limited <object> support in its Version 4 release, and full support in Version 6. Currently, the <object> tag enjoys a hearty endorsement by the HTML 4.01 specification as the "right" way to add any media object to a web page.
The <object> tag has a large number of attributes that customize its use to the type of media being placed. It shares many attributes with the <img> tag for controlling placement on the page (such as align, width, height, vspace, and hspace).
The syntax for the <object> tag varies with the type of content it is placing. The following examples should provide a general understanding of its use.
Adding an image
In this example, the <object> tag is used simply to place an image on the page.
Adding plug-in media
The <object> tag can also be used to place media played by browser plug-ins and helper applications, such as Flash or Director movies. Note that some browsers support only the <embed> tag for embedding plug-in media, so in many cases you'll need to use a combination of the two tags. This is discussed in more detail in Part IV.
In this example, a Flash movie is added via the <object> tag.
When used for a plug-in media type, classid functions like <embed>'s pluginurl attribute, which points to the place where the appropriate plug-in can be found and automatically installed. In this case, it points to an ActiveX control that will be used to play the movie for Internet Explorer users on Windows machines.
codebase provides a base URL based on which relative URLs for classid, data, and archive attributes should be evaluated.
Some plug-in media and applets require width and height values in order to play correctly, so be sure to read any documentation provided for your media type.
The <embed> Tag
The <embed> tag places a media object, such as a Flash movie or the controls for a RealAudio track, on a web page. It displays the media object in a rectangular area that behaves much like an inline image in terms of text flow positioning. The <embed> tag was originally created by Netscape for use with plug-in technologies. It is currently supported by both browsers; however, the HTML 4.01 specification prefers the use of the <object> tag with the data attribute for the placement of multimedia elements.
When the browser encounters the <embed> tag, it matches the suffix of the file name (Navigator also looks for the value of the type attribute) with the appropriate plug-in.
The following is a very simple example of the <embed> tag:<EMBED SRC="url" HEIGHT="165" WIDTH="250" ALIGN="right" HSPACE="6"></EMBED>
The src attribute is required to tell the browser the location of the media file to be played. Many media types require that the width and height values (the dimensions of the plug-in element in pixels) be specified in order for the plug-in to function.
If you are triggering plug-in functions from a script, you need to give the element a name using the name attribute.
Like images, media objects can be positioned using the align attribute and its related hspace and vspace settings. In Internet Explorer, you can also specify alternative text with the familiar alt attribute.
There are a few special attributes supported only by Version 4.0 and higher browsers that you might also want to include. To hide the media file or object from view, use the hidden attribute with a value of yes. The pluginspage attribute provides the URL of a page where the user can download information for the required plug-in should it not be found on the client machine. Netscape 4.0 introduced the pluginurl attribute, which specifies a link to a function that installs the plug-in automatically.
In addition to these standard attributes, the <embed> tag may also contain plug-in-specific attributes for controlling the function of the player. The attributes loop, autostart, autoplay, and volume are examples of media-specific controls.
The <noembed> tag provides alternative content that displays if the browser cannot display the specified media file. In the following example, the browser would display the GIF file in place of the media object.
Web Designing Related Interview Questions
|HTML Interview Questions||HTML 5 Interview Questions|
|Flash Interview Questions||Graphic Design Interview Questions|
|Illustrator Interview Questions||Dreamweaver Interview Questions|
|UI Developer Interview Questions||Dreamweaver CS3 Interview Questions|
|CSS Advanced Interview Questions||Web Developer Guide Interview Questions|
|Log Shipping Interview Questions||Spring Boot Interview Questions|
|UI Designer Interview Questions||Bootstrap 4 Interview Questions|
Web Designing Related Practice Tests
|HTML Practice Tests||HTML 5 Practice Tests|
|Flash Practice Tests||Graphic Design Practice Tests|
|Illustrator Practice Tests||Dreamweaver Practice Tests|
|UI Developer Practice Tests||Dreamweaver CS3 Practice Tests|
|Web Developer Guide Practice Tests||Advanced jQuery Practice Tests|
Web Designing Tutorial
Designing For A Variety Of Browsers
Designing For A Variety Of Displays
Web Design Principles For Print Designers
A Beginners Guide To The Server
Printing From The Web
Structural Html Tags
Adding Images And Other Page Elements
Specifying Color In Html
Cascading Style Sheets
Server Side Includes
Designing Graphics With The Web Palette
Audio On The Web
Video On The Web
Flash And Shockwave
Introduction To Smil
Introduction To Dhtml
Introduction To Xml
Wap And Wml
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.