English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
This article introduces the usage of the HTML a shape attribute, including online examples demonstrating how to use the HTML a shape attribute, browser compatibility, syntax definition, and detailed information about its attribute values.
Using the shape and coords attributes of the <a> element to create image maps:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML a shape 属性-基础教程网(oldtoolbag.com)</title> body>/head> <body> <object data="planets.gif" alt="Planets" type="image/gif" usemap="#Map1"> <map name="Map1"> <a href="sun.html" shape="rect" coords="0,0,82<a href="venus.html" shape="circle" coords="126">The Sun</">Venus< <a href="mercur.html" shape="circle" coords="90,58<a href="venus.html" shape="circle" coords="30,/">Venus< ">Mercury<124<a href="venus.html" shape="circle" coords="58<a href="venus.html" shape="circle" coords="8,/">Venus< body>/a> body>/map> body>/object> body>/<html>/Test it out ‹
Browser CompatibilityIEFirefoxOperaChrome
Safari
Define and Usage5 HTML
The shape attribute is not supported in the <a> tag anymore. coords Use the attribute together with, to specify the size, shape, and position of the link in the <object> or <img> element.
Tip:To create an image map that is compatible with all browsers, please use <area> Element!
<a shape="value">
Value | Description |
---|---|
default | Specify all areas. |
rect | Define a rectangular area. |
circle | Define a circle. |
poly | Define a polygonal area. |