You are here: Reference > HTML > attributes > type (a, embed, link, object, ...)

type attribute (a, embed, link, object, ...)

Browser support:
Specifies the content type (MIME type) of the object or the linked object.
To avoid any inconsistencies, specify the exact MIME type for the linked object. If you want to specify the MIME type of an application that can be used for the data of an object element, use the codeType attribute.
JavaScript page for this attribute: type. You can find other example(s) there.

Possible values:

String that sets the content type. See MIME types for more information.
Default: this attribute has no default value.

Example HTML code 1:

This example illustrates the use of the type attribute for a elements:
<a id="myAnchor" href="testVideo.mpg" type="video/mpeg">Click to see the movie</a>
Did you find this example helpful? yes no

Example HTML code 2:

This example shows how to link a style document into a HTML document:
Code
style.css
<head>
    <link rel="stylesheet" type="text/css" href="style.css" />
</head>
Did you find this example helpful? yes no

Example HTML code 3:

This example illustrates the use of the type attribute for object elements:
Code
HelloWorld.java
<object type="application/x-java-applet" code="HelloWorld.class" width="200px" height="50px">
    <param name="codebase" value="/external/examples/common/java/" />
</object>
Did you find this example helpful? yes no

Example HTML code 4:

This example shows how to tell the client's browser that you offer a search plugin from HTML. If the search provider is currently installed it will be selected search engine. Note that the AddSearchProvider method provides similar functionality in JavaScript.
Code
searchProvider.xml
<head>
    <link rel="search" type="application/opensearchdescription+xml" 
        href="searchProvider.xml" title="Dottoro Search" /> 
</head>
<body>
    Please open the drop-down menu of your browser's Search Box.
</body>
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content