English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML reference manual

HTML tag大全

HTML: <area> shape attribute

The shape attribute specifies the shape of the area, and the shape attribute is used with the coords attribute to specify the size, shape, and position of the area.

 HTML <area> balise

Online example

Image map with clickable areas:

!DOCTYPE html>
<html>
<title>HTML:<area> shape attribute - 基础教程网 oldtoolbag.com</title>
<body>
<p>Click on the sun or another planet to observe it closely:</p>
<img src="planets.gif" width="145" height="126" alt="Planets" usemap="#planetmap">
<map name="planetmap">
  <area shape="rect" coords="0,0,82,126"href="sun.html" alt="Sun">
  <area shape="circle" coords="90,58,3" href="mercur.html" alt="Mercury">
  <area shape="circle" coords="124,58,8" href="venus.html" alt="Venus">
</map>
</body>
</html>
Testez et voyez ‹/›

Compatibilité du navigateur

IEFirefoxOperaChromeSafari

Tous les navigateurs populaires prennent en charge l'attribut shape

Définition et utilisation

L'attribut shape spécifie la forme de la région.

L'attribut shape avec coords En combinaison avec les attributs HTML, pour spécifier la taille, la forme et la position de la région.

HTML 4.01 et HTML5Les différences entre

Aucune.

Syntaxe

<area shape="default|rect|circle|poly">

Valeur de l'attribut

ValeurDescription
defaultDéfinir toutes les régions.
rectDéfinir une région rectangulaire.
circleDéfinir une circle.
polyDéfinir une région polygonale.

 HTML <area> balise