YouTip LogoYouTip

Att Area Nohref

# HTML nohref Attribute The `nohref` attribute of the `` tag is used to define an active region within an image map that has no associated hyperlink. This tutorial provides a comprehensive guide to the `nohref` attribute, its historical context, modern alternatives, and syntax. --- ## Introduction and Usage In HTML image maps, the `` element defines geometric regions (like rectangles, circles, or polygons) on an image. By default, these regions are interactive. The `nohref` attribute is a boolean attribute. When present, it explicitly declares that the specified area does not link to any destination. > ⚠️ **Important Deprecation Notice:** > The `nohref` attribute is **deprecated and obsolete in HTML5**. Modern web standards no longer support it. To achieve the same effect in modern web development, simply omit the `href` attribute from the `` tag. --- ## Syntax ### HTML Syntax In standard HTML, the attribute can be written as a minimized boolean attribute: ```html Description ``` ### XHTML Syntax In XHTML, attribute minimization is forbidden. The attribute must be explicitly defined with its value: ```xml Description ``` --- ## Code Example Below is an example of an image map containing three defined areas. One area (the Sun) is explicitly set to have no hyperlink using the `nohref` attribute, while the other two areas (Mercury and Venus) link to their respective pages. ```html Planets Sun Mercury Venus ``` --- ## Browser Support and Compatibility | Attribute | Chrome | Firefox | Internet Explorer / Edge | Safari | Opera | | :--- | :---: | :---: | :---: | :---: | :---: | | **nohref** | ❌ Not Supported | ❌ Not Supported | ❌ Not Supported | ❌ Not Supported | ❌ Not Supported | Modern web browsers do not support or process the `nohref` attribute because it has been completely removed from the HTML5 specification. --- ## Modern Best Practices If you want to define an area in an image map that does not trigger a link, follow these modern guidelines: 1. **Omit the `href` Attribute:** The simplest and standard-compliant way to create a non-clickable area is to omit the `href` attribute entirely. ```html Sun ``` 2. **Provide `alt` Text:** Even if an area is not clickable, always provide an `alt` attribute to ensure your image map remains accessible to screen readers and visually impaired users.
← Bootstrap V2 Grid SystemAtt A Rel β†’