Atributo de coordenadas HTML <área>
Exemplo
Use o atributo coords para especificar as coordenadas de cada área no mapa de imagem:
<map
name="planetmap">
<area shape="rect" coords="0,0,82,126" href="sun.htm" alt="Sun">
<area shape="circle" coords="90,58,3" href="mercur.htm" alt="Mercury">
<area shape="circle" coords="124,58,8" href="venus.htm" alt="Venus">
</map>
Definição e uso
O coords
atributo especifica as coordenadas de uma área em um mapa de imagem.
O coords
atributo é usado junto com o shape
atributo para especificar o tamanho, a forma e o posicionamento de uma área.
Dica: As coordenadas do canto superior esquerdo de uma área são 0,0.
Suporte ao navegador
Attribute | |||||
---|---|---|---|---|---|
coords | Yes | Yes | Yes | Yes | Yes |
Sintaxe
<area coords="value">
Valores de atributo
Value | Description |
---|---|
x1,y1,x2,y2 | Specifies the coordinates of the top-left and bottom-right corner of the rectangle (shape="rect") |
x,y,radius | Specifies the coordinates of the circle center and the radius (shape="circle") |
x1,y1,x2,y2,..,xn,yn | Specifies the coordinates of the edges of the polygon. If the first and last coordinate pairs are not the same, the browser will add the last coordinate pair to close the polygon (shape="poly") |
❮ Tag HTML <área>