Skip to: content, navigation

by Ian Lloyd

nohref (HTML attribute)

Spec
Depr. Version
No HTML 2
Browser support full matrix
IE7 FF2 Saf3 Op9.5
None None None None
nohref="nohref"

Example

The nohref attribute is used here in place of an href:

<map name="bigthings" id="bigthings">
  <area shape="rect" coords="35,4,205,108"
      nohref="nohref"
      alt="The giant prawn, another of Australia's Big Things"/>
  ⋮
</map>
<p><img src="giant-prawn.jpg" alt="The Giant Prawn at Ballina"
border="0" usemap="#bigthings"/></p>

Description

The nohref attribute is intended to inform the browser that an href attribute isn’t present, when in fact you could more easily do that by, well, not including an href!

The example shows the specification of the nohref in XHTML-compliant syntax, with an attribute and value pairing, but it can be used as an attribute on its own in HTML, as shown below:

<map name="bigthings" id="bigthings">
  <area shape="rect" coords="35,4,205,108" nohref
      alt="The giant prawn, another of Australia's Big Things"/>
  ⋮
</map>
<p><img src="giant-prawn.jpg" alt="The Giant Prawn at Ballina"
border="0" usemap="#bigthings"/></p>

Value

"nohref" is the only value this attribute can take.

Compatibility

IE5.5None
6.0None
7.0None
Firefox1.0None
1.5None
2.0None
Safari1.3None
2.0None
3.0None
Opera9.2None
9.5None

The HTML specifications provide no indication as to what browsers should do with this attribute, so it’s difficult to say which browsers are and aren’t compatible. All the tested browsers have been described as providing no support for this attribute, although given that they have no guide on what they should be doing to support it, this seems unfair.

In essence, this attribute is entirely useless, and you have little to gain from using it.

User-contributed notes

There are no comments yet.

Add a note

To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

Related Products

The Principles of Beautiful Web Design

Best Seller!

You don’t need to go to Art School to design great looking web sites!

Book Cover: The Principles of Beautiful Web Design

Download the FREE sample chapters