A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/html/elements/area below:

area · WebPlatform Docs

area Summary

Represents either a hyperlink with some text and a corresponding area on an image map, or a dead area on an image map.

Overview Table
DOM Interface
HTMLAreaElement
HTML Attributes
Global attributes: accesskey, class, contenteditable, dir, hidden, id, lang, spellcheck, style, tabindex, title, translate
See global attributes.
alt = fallback content for the image map
If the area element has a href attribute, the alt attribute must be present.
The alt attribute may be left blank if there is another area element in the same image map that points to the same resource and has a non-blank alt attribute.
coords = valid list of integers
This attribute gives the coordinates for the shape described by the shape attribute. The processing for this attribute is described as part of the image map processing model.
shape = “circle” / “poly” / “rect” / “default”
href = URL potentially surrounded by spaces
A URL that provides the destination of the hyperlink. If the href attribute is not specified, the element represents a placeholder hyperlink.
target = browsing-context name or keyword
A name or keyword giving a browsing context for UAs to use when following the hyperlink.
The target attribute on the a element was deprecated in a previous version of HTML, but is no longer deprecated, as it is useful in Web applications, particularly in combination with the iframe element.
Any string that is either of the following:
rel = set of space-separated tokens
A list of tokens that specify the relationship between the document containing the hyperlink and the destination indicated by the hyperlink.
hreflang = language tag
The language of the destination of the hyperlink.
A valid language tag, as defined in [BCP47].
media = media-query list
The media for which the destination of the hyperlink was designed.
A valid media query list, as defined in [MediaQueries].
type = MIME type
The MIME type of the destination of the hyperlink.
A string that identifies a valid MIME media type, as defined in [RFC2046].
Examples

The following example uses the area element inside a parent map element to create an image map of the solar system. Each area element defines and provides a link to an image on the map using the coords and shape attributes to specify its dimensions and shape, respectively; and the title attribute to provide a descriptive pop-up tooltip when pointed to with the mouse. A tooltip is especially useful if the image file is missing or cannot be displayed for whatever reason.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
 <meta http-equiv="X-UA-Compatible" content="IE=8"/>
  <title>Image Map Example</title>
  <base href="http://samples.msdn.microsoft.com"/>
</head>
<body>
<p><img src="/workshop/graphics/solarsys.png" width=504 height=126 border=0
    title="Solar System" usemap="#SystemMap"/></p>
  <map name="SystemMap">
      <area shape="rect" coords="0,0,82,126"
        href="/workshop/graphics/sun.png" title="Sun"/>
      <area shape="circle" coords="90,58,3"
        href="/workshop/graphics/merglobe.png" title="Mercury"/>
      <area shape="circle" coords="124,58,8"
        href="/workshop/graphics/venglobe.png" title="Venus"/>
      <area shape="circle" coords="162,58,10"
        href="/workshop/graphics/earglobe.png" title="Earth"/>
      <area shape="circle" coords="203,58,8"
        href="/workshop/graphics/marglobe.png" title="Mars"/>
      <area shape="poly" coords="221,34,238,37,257,32,278,44,284,60,
        281,75,288,91,267,87,253,89,237,81,229,64,228,54"
        href="/workshop/graphics/jupglobe.png" title="Jupiter"/>
      <area shape="poly" coords="288,19,316,39,330,37,348,47,351,66,
        349,74,367,105,337,85,324,85,307,77,303,60,307,50"
        href="/workshop/graphics/satglobe.png" title="Saturn"/>
      <area shape="poly" coords="405,39,408,50,411,57,410,71,404,78,
        393,80,383,86,381,75,376,69,376,56,380,48,393,44"
        href="/workshop/graphics/uraglobe.png" title="Uranus"/>
      <area shape="poly" coords="445,38,434,49,431,53,427,62,430,72,
        435,77,445,92,456,77,463,72,463,62,462,53,455,47"
        href="/workshop/graphics/nepglobe.png" title="Neptune"/>
      <area shape="circle" coords="479,66,3"
        href="/workshop/graphics/pluglobe.png" title="Pluto"/>
  </map>
</body>
</html>

View live example

Notes Remarks

Any number of area elements can be contained within the same map element. The format of the coords value depends on the value of the shape attribute. Windows Internet Explorer 8 and later. In IE8 Standards mode, the title attribute is preferred over the alt attribute when specified as a pop-up tooltip for an img or a map element. In addition, the value of the href attribute depends on the current document compatibility mode. This element is not rendered. This element does not require a closing tag.

Related specifications
HTML 5.1
W3C Working Draft
HTML 5
W3C Recommendation
HTML 4.01
W3C Recommendation
Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4