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

HTML Reference Manual

Complete List of HTML Tags

HTML: <a> shape attribute

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.

HTML <a> tag

Online Examples

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

Currently, only Firefox and Opera support the shape attribute.

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!

Syntax

<a shape="value">

Attribute value

ValueDescription
defaultSpecify all areas.
rectDefine a rectangular area.
circleDefine a circle.
polyDefine a polygonal area.

HTML <a> tag