?
Solved

W3C error

Posted on 2014-04-02
2
Medium Priority
?
315 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 53

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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 article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
Suggested Courses

741 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