?
Solved

W3C error

Posted on 2014-04-02
2
Medium Priority
?
327 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 54

Accepted Solution

by:
Scott Fell,  EE MVE earned 980 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

650 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