Links & Navigation
HTML <map> element
Defines an image map containing area elements. Its name is referenced by the image's usemap attribute. The example uses illustrative local asset paths; supply matching files before running it. The name ties the map to an img usemap fragment reference. Coordinates relate to the rendered image map geometry; resizing and responsive layouts require testing. Provide ordinary navigation alternatives where needed. It accepts global HTML attributes; individual global features may be inapplicable or restricted.
Formal Syntax & Structure
html syntaxhtml
<map name="regions">Areas</map>Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| name | string | Provides an element-specific name: a form field key, radio group name, named frame, metadata key, slot name or other defined purpose. Its meaning depends on the element; it is not a unique DOM identifier. |
Return Value
HTMLMapElement
Content model: Transparent content with area elements for image-map regions.
Working Example
Example Snippethtml
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <title>HTML example</title> </head> <body> <img src="plan.png" alt="Floor plan" usemap="#rooms" width="100" height="100"> <map name="rooms"> <area shape="rect" coords="0,0,50,50" href="#room" alt="Room A"> </map> <p id="room">Room A</p> </body></html>