Fandom

HTML & CSS Wiki

Area

649pages on
this wiki
Add New Page
Comments0 Share

The void HTML <area /> element defines a hot-spot region on an image, and optionally associates it with a hypertext link. This element is used only within a <map> element.

AttributesEdit

Attribute Value Description
alt text string A text string alternative to display on browsers that do not display images. The text should be phrased so that it presents the user with the same kind of choice as the image would offer when displayed without the alternative text. This attribute is only required if the href attribute is present. (HTML5)
coords pixels A set of values specifying the coordinates of the hot-spot region. The number and meaning of the values depend upon the value specified for the shape attribute. For a rect or rectangle shape, the coords value is two x,y pairs: left, top, right, and bottom. For a circle shape, the value is x,y,r where x,y is a pair specifying the center of the circle and r is a value for the radius. For a poly or polygon< shape, the value is a set of x,y pairs for each point in the polygon: x1,y1,x2,y2,x3,y3, and so on. In HTML5 the values are written in CSS pixels.
href URL The hyperlink target for the area. Its value is a valid URL. This attribute may be omitted; if so, this element does not represent a hyperlink.
hreflang [1] Indicates the language of the linked resource. Allowed values are determined by BCP47. Use this attribute only if the href attribute is present.
media hint A hint of the media for which the linked resource was designed, for example print and screen. If omitted, it defaults to all. Use this attribute only if the href attribute is present. (HTML5)
rel 1,2,3,4 For anchors containing the href attribute, this attribute specifies the relationship of the target object to the link object. The value is a comma-separated list of relationship values. The values and their semantics will be registered by some authority that might have meaning to the document author. The default relationship, if no other is given, is void. Use this attribute only if the href attribute is present. (HTML5)
target _self
_blank
_parent
_top
This attribute specifies where to display the linked resource. It is a name of, or keyword for, a browsing context (for example, tab, window, or inline frame).


  • _self: Load the response into the same browsing context as the current one. This value is the default if the attribute is not specified.
  • _blank: Load the response into a new unnamed browsing context.
  • _parent: Load the response into the parent browsing context of the current one. If there is no parent, this option behaves the same way as _self.
  • _top: Load the response into the top-level browsing context (that is, the browsing context that is an ancestor of the current one, and has no parent). If there is no parent, this option behaves the same way as _self.


Use this attribute only if the href attribute is present.

type MIME type This attribute specifies the media type in the form of a MIME type for the link target. Generally, this is provided strictly as advisory information; however, in the future a browser might add a small icon for multimedia types. For example, a browser might add a small speaker icon when the MIME type is set to audio/wav. For a complete list of recognized MIME types, see [2]. Use this attribute only if the href attribute is present.

HTML example:

<map name="primary">
<area shape="circle" coords="200,250,25" href="another.html" /> 
</map>


Coding rules Edit

The <area> element belongs to the Flow content category.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.