English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Use the shape and coords attributes in the <a> element to create image maps:
<!doctype html> <html> <head> <title>html: Use of coords attribute in <a> - Basic Tutorial (oldtoolbag.com)</title> </head> <body> <p>Click on the sun or nearby planets in the image:</p> <object data="planets.gif" alt="Planets" type="image/gif" usemap="#Map1"> <map name="Map1"> <a href="sun.html" shape="rect" coords="0,0,82,126">Sun</a> <a href="mercur.html" shape="circle" coords="90,58,3">Mercury</a> <a href="venus.html" shape="circle" coords="124,58,8">Venus</a> </map> </object> <p><b>Attention:</b> Currently only <b>Firefox</b> and <b>Opera</b> browsers support the <b>coords</b> attribute.</p> </body> </html>Test and see ‹/›
IEFirefoxOperaChromeSafari
Al momento, solo i browser Firefox e Opera supportano l'attributo coords.
HTML5 non supporta l'attributo coords dell'<a>.
L'attributo coords viene solitamente utilizzato insieme a shape Utilizzare insieme gli attributi per determinare le dimensioni, la forma e la posizione del collegamento degli elementi <object> o <img>.
Le coordinate dell'angolo superiore sinistro sono 0,0.
Suggerimento:Per creare una mappa immagine utilizzabile in tutti i browser, utilizzare <area> Elemento.
<a coords="value">
Valore | Descrizione |
---|---|
x1,y1,x2,y2 | Se l'attributo shape è impostato su "rect", questo valore definisce le coordinate dell'angolo superiore sinistro e dell'angolo inferiore destro del rettangolo. |
x,y,radius | Se l'attributo shape è impostato su "circ", questo valore definisce le coordinate del centro e il raggio del cerchio. |
x1,y1,x2,y2,...,xn,yn | Se l'attributo shape è impostato su "poly", questo valore definisce le coordinate dei lati del poligono. Se la prima e l'ultima coordinate non sono le stesse, per chiudere il poligono, il browser deve aggiungere l'ultima coppia di coordinate. |