| Depr. | Version |
|---|---|
| No | HTML 2 |
| IE8 | FF2 | SA4 | OP10 | CH2 |
|---|---|---|---|---|
| None | None | None | None | None |
Syntax
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>
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>
Value
"nohref" is the
only value this attribute can take.
Compatibility
| Internet Explorer | Firefox | Safari | Opera | Chrome | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 5.5 | 6.0 | 7.0 | 8.0 | 1.0 | 1.5 | 2.0 | 1.3 | 2.0 | 3.1 | 4.0 | 9.2 | 9.5 | 10.0 | 2.0 |
| None | None | None | None | None | None | None | None | None | None | None | None | None | None | None |
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.