HTML nohref Attribute
The obsolete HTML nohref attribute was historically used on the <area> element to indicate that a region of an image map was not a hyperlink and could not be selected as a link.
nohref attribute is obsolete and should not be used in modern HTML. To create a non-linking area in an image map, simply omit the href attribute from the <area> element.
Historical Syntax
The nohref attribute was a Boolean attribute placed on an <area> element:
<area shape="rect"
coords="100,50,200,150"
nohref>
The defined region remained part of the image map, but it did not provide a hyperlink destination.
Historical Elements
The obsolete nohref attribute was associated with the <area> element used inside an image map.
| Element | Historical Purpose |
|---|---|
<area> |
Indicated that a defined region of an image map did not create a hyperlink. |
Historical Use
Image maps divide an image into defined regions using <area> elements. Areas containing an href attribute act as hyperlinks and can send the user to another resource when selected.
The nohref attribute was used when an author wanted to define an area without making that region a hyperlink.
<map name="example-map">
<area shape="rect"
coords="0,0,100,100"
href="page.html"
alt="Linked Area">
<area shape="rect"
coords="100,0,200,100"
nohref>
</map>
In this example, the first area created a hyperlink while the second represented a non-linking region.
Why It Became Obsolete
The nohref attribute became unnecessary because the absence of href already provides the required behavior. An <area> element without an href attribute does not create a hyperlink.
Modern HTML therefore expresses a non-linking image map area simply by leaving out href, eliminating the need for a separate Boolean attribute.
Modern Alternative
Remove the obsolete nohref attribute and omit href from the <area> element.
Historical HTML
<area shape="rect"
coords="100,50,200,150"
nohref>
Modern HTML
<area shape="rect"
coords="100,50,200,150">
The modern version defines the same rectangular region without creating a hyperlink. No replacement attribute is necessary.
When an <area> element does have an href attribute, it represents a hyperlink and should provide appropriate alternative text with the alt attribute. When href is absent, the area is not selectable as a hyperlink and the alt attribute must also be omitted. :contentReference[oaicite:1]{index=1}
Legacy Browser Support
The nohref attribute was supported as part of older image map markup and may still be recognized when browsers process legacy webpages.
Modern webpages should not rely on the attribute. Omitting href from an <area> element is the current HTML method for defining an area that does not create a hyperlink. :contentReference[oaicite:2]{index=2}
For additional information about historical browser compatibility, visit Can I Use? . Search for the HTML element or attribute you want to check. Search results can include related HTML features, element attributes, APIs, and other technologies, so select the result that most closely matches the legacy feature you are researching.
Related Attributes
Current attributes used with the <area> element include:
href- Specifies the hyperlink destination when an area should act as a link.shape- Specifies the shape of the image map area.coords- Specifies the coordinates that define the area.alt- Provides replacement text for an image map hyperlink whenhrefis present.
Specifications
The nohref attribute on the <area> element is obsolete and must not be used by authors. Omitting the href attribute is sufficient. See the WHATWG HTML Living Standard for information about obsolete and non-conforming features.
