YouTip LogoYouTip

Att Map Name

## HTML <map> name Attribute The `name` attribute of the `` tag is a required attribute used to define the name of an image map. It establishes a direct relationship between an image (``) and the clickable areas defined inside the `` element. --- ## Introduction An image map is an image with clickable active areas (often called "hotspots"). The `` element contains a number of `` elements that define these active regions. To link an image to a map, the `usemap` attribute of the `` tag must match the value of the `name` attribute of the `` tag (preceded by a hash symbol `#`). --- ## Browser Support The `name` attribute is fully supported by all major modern web browsers: * Google Chrome * Mozilla Firefox * Microsoft Edge / Internet Explorer * Safari * Opera --- ## Syntax ```html ``` ### Attribute Values | Value | Description | | :--- | :--- | | *mapname* | Specifies the unique name of the image map. | --- ## Code Example Below is a complete example of an image map with three clickable regions representing different celestial bodies. ```html Planets Sun Mercury Venus ``` --- ## Technical Considerations ### HTML 4.01 vs. HTML5 Differences There are no functional differences for the `name` attribute between HTML 4.01 and HTML5. However, in HTML5, if the `id` attribute is also specified on the `` element, it must have the exact same value as the `name` attribute. ### Best Practices 1. **Uniqueness**: Ensure that the `name` attribute value is unique within the HTML document to prevent conflicts when linking multiple image maps. 2. **Case Sensitivity**: The value of the `usemap` attribute in the `` tag is case-sensitive and must match the `name` attribute of the `` tag exactly. 3. **The Hash Symbol**: Always remember to prefix the `usemap` value in the `` tag with a `#` (e.g., `usemap="#planetmap"`), while keeping the `` tag's `name` attribute value without the hash (e.g., `name="planetmap"`).
← Att Meter ValueAtt Link Type β†’