HTML and CSS Reference
Internet Content Types
Internet media types, also referred to as content types or MIME types, are used to
describe the format of a file or resource. They're a more robust version of a file
extension. For example, a PNG image usually has the extension .png . The MIME
type for PNG files is image/png . Microsoft Word documents have the extension .doc
(or more recently, .docx ) and the MIME type application/msword . These types
were originally used to identify the types of email attachments—MIME is short for
Multipurpose Internet Mail Extensions—but these days, they're used in other cases
where information about file types needs to be exchanged.
In the case of the <object> tag, you specify an Internet media type so that the
browser can determine the best way to render the content referenced by that tag.
The Internet media type for Flash is application/x-shockwave-flash , if that type
is specified, the browser knows to use the Flash plug-in.
There's one other important use for these types when it comes to video and sound
files. When a web server sends a resource to the Web, it includes a content type.
The browser looks at the content type to determine what to do with the resource.
For example, if the content type is text/html , it treats it as a web page.
When a web server sends files to users, it figures out the Internet media type using
the file extension. So if a user requests index.html , the web server knows that an
extension of .html indicates that the files should have the content type text/html .
Later in this lesson, I discuss how to make sure that your web server sends the
right content types for video and audio files that you use.
With most tags, you could just combine all the attributes and wind up with an <object>
that works with all the popular browsers. With <object> , it doesn't work that way.
However, there's a way around this problem. Here's a version that will work:
<object classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000” width=”780”
<param name=”movie” value=”movie.swf” />
<object type=”application/x-shockwave-flash” data=”myContent.swf” width=”780”
In this example, one of the <object> tags is nested inside the other. This works because
browsers ignore tags they don't understand, so browsers that aren't Internet Explorer
ignore the outer <object> tag. Internet Explorer ignores tags nested inside an <object>
tag, except for the <param> tag, so it ignores the inner <object> . That's the simplest
approach to using the <object> tag in a way that works with all browsers.
Search WWH ::