HTML nohref Attribute

Beginner
4 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The nohref attribute was a Boolean on <area> inside a client-side image map. It meant the region was not a hyperlink. In HTML 4, an <area> was expected to have either href or nohref.

The HTML Standard lists nohref as obsolete: authors must not use it. Omitting href is enough — an area without href is not a link. If there is no href, also omit alt.

Deprecated / obsolete.

Do not ship nohref on new pages. Recognize it in legacy maps, then migrate by removing nohref and leaving href off non-link regions.

HTML Syntax

syntax.html
<!-- obsolete --> <area … nohref>
<!-- modern --> <area shape="…" coords="…">  ← no href

Modern rule: skip both nohref and href when the region should not navigate.

Attribute Values

Boolean historically — presence meant “not a link.” Prefer the modern column:

PatternDescriptionTry it
nohref (legacy)HTML4 Boolean: area is not a hyperlinkTry it
Omit href (modern)Standard replacement — area cannot be selected as a linkTry it
With hrefArea is a real link — provide altTry it
No href + no altRequired pairing when the area is not a linkTry it

Live Preview

Compare legacy nohref wording with the modern “omit href” markup. The map uses a real image; only the linked half navigates.

Left half has href (clickable). Right half is non-link — modern markup omits href.

Image map
JavaScript logo image map demoLearn JavaScript
<area shape="rect" coords="64,0,128,128"> <!-- no href -->

HTML Examples

Legacy markup to recognize, then modern replacements. Use Try It Yourself for a live editor.

Example 1 — Legacy nohref (Do Not Copy for New Work)

HTML4-style Boolean: region present in the map but not a link.

HTML
<!-- Obsolete — for recognition only -->
<img src="/images/javascript.png" alt="Demo" usemap="#legacy-map" width="128" height="128">
<map name="legacy-map">
  <area shape="rect" coords="0,0,64,128" href="/js/interview" alt="Learn JavaScript">
  <area shape="rect" coords="64,0,128,128" nohref>
</map>
Try It Yourself

How It Works

  1. Left area has href — it is a real link.
  2. Right area used nohref in HTML4 to mean “not a link.”
  3. Obsolete today — the Standard says omit href instead.
  4. Do not add nohref to new projects.

Example 2 — Modern: Omit href

Same intent without nohref. No link, no alt.

HTML
<img src="/images/javascript.png" alt="Demo" usemap="#modern-map" width="128" height="128">
<map name="modern-map">
  <area shape="rect" coords="0,0,64,128" href="/js/interview" alt="Learn JavaScript">
  <area shape="rect" coords="64,0,128,128">
</map>
Try It Yourself

How It Works

  1. Drop nohref entirely.
  2. Omit href on regions that should not navigate.
  3. Omit alt when there is no href (spec requirement).
  4. Keep shape/coords if you still need the geometry in the map.

Example 3 — Linked + Non-Linked Regions

A practical map: one hotspot links; the rest of the image stays inert.

HTML
<img
  src="/images/javascript.png"
  alt="JavaScript logo"
  usemap="#mixed-map"
  width="128"
  height="128">
<map name="mixed-map">
  <area
    shape="circle"
    coords="64,64,40"
    href="/js/interview"
    alt="Open JavaScript lessons">
  <!-- Remaining pixels: no area / or area without href -->
</map>
Try It Yourself

How It Works

  1. Define only the hotspots that should link.
  2. Pixels outside those areas are not links by default.
  3. You rarely need an inert <area> at all.
  4. If you do, omit href (never add nohref).

Edge Cases & Pitfalls

Most issues are obsolete markup and incorrect alt rules.

obsolete

Do not use nohref in new HTML

Validators and the Standard reject it for authors. Omit href instead.

alt

No href → no alt

Linked areas need alt. Non-link areas must omit alt.

boolean

nohref="false" was never a good idea

Like other Booleans, presence meant “on.” Modern code should not include the attribute at all.

simpler

Prefer fewer areas

Often you only need <area> elements for the clickable hotspots — no inert filler areas.

migrate

Updating old maps

Delete nohref. If the area should stay non-link, leave href off and remove any alt.

Browser Support

nohref is an obsolete HTML attribute for <area>. Engines may still parse it, but authors must not use it.

✓ Obsolete · Do not use

nohref

Listed as obsolete in the HTML Standard. Omitting href is the supported way to make a non-link area. Legacy nohref may still parse in many browsers for compatibility.

— Authoring status
Google Chrome Parses legacy; use omit href
Obsolete
Mozilla Firefox Parses legacy; use omit href
Obsolete
Apple Safari Parses legacy; use omit href
Obsolete
Microsoft Edge Parses legacy; use omit href
Obsolete
Opera Parses legacy; use omit href
Obsolete
Samsung Internet Parses legacy; use omit href
Obsolete
Internet Explorer Legacy HTML4 support
Legacy
nohref Obsolete — omit href instead

Bottom line: Do not author nohref. For non-clickable regions, omit href (and omit alt). For links, set href and alt.

Key Takeaways

  • Was: Boolean on <area> meaning “not a hyperlink.”
  • Now: obsolete — omit href instead.
  • alt rule: required with href; omit without href.
  • Tip: often you only need areas for the clickable hotspots.

One line: nohref is obsolete — make a non-link area by leaving href off.

Frequently Asked Questions

On area elements in image maps, nohref was a Boolean that meant the region was not a hyperlink. In HTML4, an area needed either href or nohref.
No. The HTML Standard lists it as obsolete. Omit the href attribute instead — an area without href is not a link.
Leave href off the area. If there is no href, omit alt as well. Keep shape and coords to describe the region if you still need the geometry.
Many engines still parse it for compatibility, but authors must not use it. New pages should omit href.
In modern HTML, yes — simply omit href. That is the correct way to mark a non-selectable region.
When the area is a link (has href), provide alt. When there is no href, the alt attribute must be omitted.

Next: nomodule

Serve classic scripts only to browsers that lack ES modules.

nomodule tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

6 people found this page helpful