Solved

W3C error

Posted on 2014-04-02
2
306 Views
Last Modified: 2014-04-03
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:

<![CDATA[
<center></center><map name="FrontPageMap">
<area shape="rect" coords="310,96,580,120" href="mailto:stay@mauitradewinds.com"></map>
<p class="hiddenText">]]>
<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.
0
Comment
Question by:ddantes
2 Comments
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 245 total points
ID: 39974134
Frontpage is the main problem...

You just need to recreate your image map.  http://www.w3schools.com/tags/tag_map.asp
<img src="planets.gif" width="145" height="126" alt="Planets" usemap="#planetmap">

<map name="planetmap">
  <area shape="rect" coords="0,0,82,126" href="sun.htm" alt="Sun">
  <area shape="circle" coords="90,58,3" href="mercur.htm" alt="Mercury">
  <area shape="circle" coords="124,58,8" href="venus.htm" alt="Venus">
</map>

Open in new window


You may not need a map and just use
<a href="mailto:stay@mauitradewinds.com">
   <img id="logo1"  src="images/logo1.png" alt="" class="scalable">
</a>

Open in new window

0
 

Author Comment

by:ddantes
ID: 39974325
That really worked.  I do want to map the link -- I prefer that to having the entire image be a link.  Thank you.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question