all
alt
ch
dir
id
min
rel
top
url
URL
urn
Expand Minimize

shape attribute | shape property

Sets or retrieves the shape of the object.

Syntax

HTML<element shape="p" ... >
JavaScript

p = object.shape

Property values

Type: String

circ

Circle

circle

Circle

poly

Polygon

polygon

Polygon

rect

Rectangle

rectangle

Rectangle

Remarks

This property applies to the a object.

Examples

This example provides the full code for an image map of the solar system. When you click the sun or any planet, you will link to the image associated with the x,y coordinate. You can click the Back button from the image to return to the solar system image map.


<p>
<img alt="Solar System" border="0" height="126" src="solarsys.png" usemap="#SystemMap" width="504">
</p>
<map name="SystemMap">
  <area coords="0,0,82,126" href="/workshop/graphics/sun.png" shape="rect">
  <area coords="90,58,3" href="/workshop/graphics/merglobe.png" shape="circle">
  <area coords="124,58,8" href="/workshop/graphics/venglobe.png" shape="circle">
  <area coords="162,58,10" href="/workshop/graphics/earglobe.png" shape="circle">
  <area coords="203,58,8" href="/workshop/graphics/marglobe.png" shape="circle">
  <area coords="221,34,238,37,257,32,278,
        44,284,60,281,75,288,91,267,87,253,89,237,81,229,
        64,228,54" href="/workshop/graphics/jupglobe.png" shape="poly">
  <area coords="288,19,316,39,330,37,348,
        47,351,66,349,74,367,105,337,85,324,85,307,77,303,
        60,307,50" href="/workshop/graphics/satglobe.png" shape="poly">
  <area coords="405,39,408,50,411,57,410,
        71,404,78,393,80,383,86,381,75,376,69,376,56,380,
        48,393,44" href="/workshop/graphics/uraglobe.png" shape="poly">
  <area coords="445,38,434,49,431,53,427,62,
        430,72,435,77,445,92,456,77,463,72,463,62,462,53,
        455,47" href="/workshop/graphics/nepglobe.png" shape="poly">
  <area coords="479,66,3" href="/workshop/graphics/pluglobe.png" shape="circle">
</map>


See also

area

 

 

Show:
© 2014 Microsoft