Skip to main content

HTML Guide

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

An href attribute with the value http:// is not a valid URL because the host section is missing.

The href attribute in the area element must contain a valid URL. A URL requires a scheme (http or https), followed by ://, and then a valid host (such as example.com). The value http:// lacks a host, making it invalid according to URL standards and resulting in a validation error. If you don’t want the area to navigate anywhere, you can use href="#" for a placeholder or omit the href attribute entirely. To link to an actual location, provide the complete URL, including the host.

Invalid example:

<map name="myMap">
  <area shape="rect" coords="30,23,183,191" href="http://" alt="" >
</map>

Valid example with a real host:

<map name="myMap">
  <area shape="rect" coords="30,23,183,191" href="http://example.com/" alt="" >
</map>

Valid example with a placeholder, no navigation:

<map name="myMap">
  <area shape="rect" coords="30,23,183,191" href="#" alt="" >
</map>

Replace http:// with a full URL or a suitable placeholder as needed for your application.

Learn more:

Related W3C validator issues