Tutorial 12: Embed with HTML - Page 8 - HTML with Style | WebReference

Tutorial 12: Embed with HTML - Page 8 - HTML with Style

index123456789exercises1

Tutorial 12: Embed with HTML - Page 8

Page 1Page 2Page 3Front Page

The first area is a circle. The first two co-ordinates specify the center of the circle, and the third is the radius of the circle. The second area is a rectangle. The first two co-ordinates specify the top left corner of the rectangle, and the other two co-ordinates specify the bottom right corner. The third area is a polygon. Every two co-ordinates specify a point that makes up the polygon. The fourth area is the default area, that is, any part of the image that isn't part of another area.

Notice that all of the AREA elements have ALT attributes. Hence, a user agent that can't handle images can offer the different areas as a menu, using the alternate text to describe the options.

What about user agents that can't understand client-side image maps at all? The HTML 4.0 specification recommends putting some content inside the MAP element for those browsers to render as an alternative to the image map, but in practice both Internet Explorer and Navigator will render this content even though they understand image maps. The best you can do is to still use an A attribute to make the image a hyperlink pointing to some default location. So our image would be something like this:

<A HREF="./"><IMG SRC="example1.gif" USEMAP="#example"></A>

Now browsers that support image maps will ignore this link and use the image map instead (as a matter of fact, if you haven't specified a default area in your image map, they'll try this link instead when the user clicks outside of the specified areas). But older browsers will follow the link and presumably do something reasonable. If you're completely paranoid, you can even give the element an ISMAP attribute and make the hyperlink point to a server-side image map. This way, if the user agent doesn't support client-side image maps but does support server-side image maps, it will use the server-side image map instead. You can accomplish this with a syntax like the following:

<A HREF="/maps/contents.map"><IMG SRC="imagemap.png" 
   USEMAP="#mymap" ISMAP></A>

Client-side image maps have been around for quite a while and are supported by most browsers. Their use instead of server-side image maps is generally a good idea.

Embedding Java Applets using APPLET

The second element that you can use instead of OBJECT is APPLET, an element used for embedding Java applets in HTML pages.

The APPLET element

Context:
Inline element
Contents:
May contain block elements and PARAM elements
Tags:
Both start-tag and end-tag are required

Attributes for the APPLET element

code (URI)
The location of the applet's class file.
codebase (URI)
The base URI used to resolve the URI specified in the code and archive attributes, if it is different from the document's base URI.
archive (URI list)
This space-separated list of URIs pointing to Java archives (JAR files) that contain class files and data used by the applet.
name (ID)
Used to give an applet a unique name, which allows several applets on the same page to communicate with each other.
Object presentational attributes
Alternative text attributes
Identifier and classification attributes
Title attribute
Inline style information attribute
Intrinsic event handler attributes

index123456789exercises1

Produced by Stephanos Piperoglou

URL: http://www.webreference.com/html/tutorial12/8.html

Created: May 28, 1998
Revised: February 25, 1999