object tag and attributes

object tag and attributes

It offers an easy solution for including objects in a web page. It allows HTML authors to specify everything required by an object for its presentation by a web browser. It tells the browser following information on the multimedia object

  • The name of the file and where to find it
  • The format of the file
  • The type of plug-in used to play the file

A webpage can be embedded in another web page as

<object data=”page1.htm” type=”text/html”

width=”300″ height=”200″>

alt : <a href=” page1.htm”> page1.htm</a>

</object>

The <object> tag is used to include objects such as images, audio, videos, Java applets, ActiveX, PDF, and Flash. It was intended to replace the img and applet elements. However, because of bugs and a lack of browser support this has not happened. Its support in browsers depends on the object type as browsers use different codes to load the same object type. But this problem is solved as if the object element is not displayed, the code between the <object> and </object> tags will be executed. Thus several nested object elements can be inserted one for each browser.

Parameters used by this tag are

Classid – It defines a class ID value as set in the Windows Registry or a URL Its value is

class_ID

Codebase – It defines where to find the code for the object Its value is URL

Codetype – The internet media type of the code referred to by the classid attribute Its value

is MIME_type.

Data – It defines a URL that refers to the object’s data Its value is a URL

Height – It defines the height of the object Its value is in pixels

Hspace – It defines the horizontal spacing around the object Its value is in pixels

Name – It defines the name for an object (to use in scripts).

Type – Defines the MIME type of data specified in the data attribute Its value is MIME_type

Vspace – Defines the vertical spacing around the object Its value is pixels

Width – Defines the width of the object Its value is pixels

Some parameters related to web page are given in the param tag as shown to embed a wav file

<object type=”audio/x-wav” data=”sound1.wav”

width=”200″ height=”20″>

<param name=”src” value=” sound1.wav”>

<param name=”autoplay” value=”false”>

<param name=”autoStart” value=”0″>

alt : <a href=” sound1.wav”> sound1.wav</a>

</object>

Adding a flash object in a web page is as

<object classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″

id=”movie1″ codebase=”website/swflash.cab”

width=”200″ height=”300″>

<param name=”movie” value=” movie/ movie1.swf” />

<param name=”quality” value=”high” />

<img src=” movie.jpg” width=”200″

height=”300″ alt=” movie1″ />

</object>

Adding a java applet in web page is done as

<object

classid=”clsid:8ad9c840-044e-11d1-b3e9-00805f499d93″

width=”200″ height=”200″>

<param name=”code” value=”applet.class”>

</object>

The classid attribute specifies version of Java Plug-in to use. The optional codebase attribute specifies if and how to download the JRE.

Apply for HTML5 Certification Now!!

http://www.vskills.in/certification/Certified-HTML5-Developer

Back to Tutorial

Share this post
[social_warfare]
Video Formats
IE-specific bgsound Tag

Get industry recognized certification – Contact us

keyboard_arrow_up