W3C home > Mailing lists > Public > www-validator@w3.org > August 2011

Re: href within <area> is supposed to be optional

From: Michael[tm] Smith <mike@w3.org>
Date: Fri, 12 Aug 2011 23:05:09 +0900
To: Antonio Zamora <antonio_zamora@verizon.net>
Cc: www-validator@w3.org
Message-ID: <20110812140509.GB40668@sideshowbarker>
Antonio Zamora <antonio_zamora@verizon.net>, 2011-08-11 18:45 -0400:

> The HTML validator gives the following error for an <area> element which has
> no href=
> 
> Validation Output: 1 Error
>    Error Line 93, Column 23: Element area is missing required attribute
> href.

The only circumstance in which the validator would emit that message is
when the area element also has an alt attribute, in which case the error
message is correct, because the spec doesn't allow alt to be specified on
area elements unless the href attribute is also specified.

  http://dev.w3.org/html5/spec/the-map-element.html#attr-area-alt

  "If the area element has an href attribute, then the area element
   represents a hyperlink. In this case, the alt attribute must be
   present... If the area element has no href attribute, then the area
   represented by the element cannot be selected, and the alt attribute
   must be omitted."

-- 
Michael[tm] Smith
http://people.w3.org/mike/+
Received on Friday, 12 August 2011 14:05:10 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:48 GMT