Posted on 2014-04-02
I've updated my site to html5 from XHTML 1.0 Transitional, and some code which previously validated is now triggering an error. The error is:
"The img element with the ismap attribute set must have an a ancestor with the href attribute." In the previous version of this page, this code was enveloped as CData, which allowed it to validate. For some reason, when checking under html5, W3C rejects the CData tag as a "bogus comment."
Here is the code which caused the error:
<area shape="rect" coords="310,96,580,120" href="mailto:email@example.com"></map>
<img id="logo1" ismap="ismap" usemap="#FrontPageMap" src="images/logo1.png" alt="" class="scalable">
Please advise how to satisfy the "ancestor href" requirement, or how to apply CData in html5 so that it will validate.