# Bad value “http://” for attribute “href” on element “area”: Invalid host: empty host.

> Canonical HTML version: https://rocketvalidator.com/html-validation/bad-value-x-for-attribute-href-on-element-area-invalid-host-empty-host
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

The `<area>` element defines a clickable region within an `<map>` element, which is used with images to create image maps. When an `<area>` element includes an `href` attribute, the browser treats it as a hyperlink. The value of `href` must be a valid URL, and `http://` alone fails validation because the URL specification requires a host after the `://` separator. An empty host is not permitted.

This matters for several reasons. Browsers may handle malformed URLs unpredictably — some might ignore the link, others might attempt navigation to a nonsensical destination, and others might throw a network error. Screen readers and other assistive technologies rely on valid `href` values to announce links correctly and provide meaningful navigation to users. From a standards compliance perspective, the WHATWG URL Standard explicitly rejects URLs with empty hosts, and the W3C validator flags this as an error.

This issue commonly appears when placeholder URLs are left in during development, when CMS tools generate incomplete markup, or when a URL value is dynamically constructed but the host portion ends up empty.

### How to fix it

- **If the area should link somewhere**, replace `http://` with the full, intended URL including the host (e.g., `https://example.com/page`).
- **If the area is a temporary placeholder**, use `href="#"` to create a valid no-op link, though be aware this will scroll the page to the top when clicked.
- **If the area shouldn't be interactive**, remove the `href` attribute entirely. Without `href`, the `<area>` element is not a hyperlink and won't be clickable.

## Examples

### Invalid: empty host in URL

The value `http://` has no host, which triggers the validation error.

```html
<img src="diagram.png" alt="Site map" usemap="#siteMap">
<map name="siteMap">
  <area shape="rect" coords="30,23,183,191" href="http://" alt="Home page">
</map>
```

### Fixed: complete URL with a valid host

Providing a full URL with a host resolves the error.

```html
<img src="diagram.png" alt="Site map" usemap="#siteMap">
<map name="siteMap">
  <area shape="rect" coords="30,23,183,191" href="https://example.com/" alt="Home page">
</map>
```

### Fixed: placeholder link with `#`

If you need the area to remain clickable but don't have a destination yet, `href="#"` is a valid placeholder.

```html
<img src="diagram.png" alt="Site map" usemap="#siteMap">
<map name="siteMap">
  <area shape="rect" coords="30,23,183,191" href="#" alt="Home page">
</map>
```

### Fixed: non-interactive area without `href`

If the area doesn't need to be a link, simply omit the `href` attribute.

```html
<img src="diagram.png" alt="Site map" usemap="#siteMap">
<map name="siteMap">
  <area shape="rect" coords="30,23,183,191" alt="Home page">
</map>
```
