W3C home > Mailing lists > Public > www-validator@w3.org > October 2010

Re: document type does not allow element "div" here?

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Fri, 1 Oct 2010 23:32:16 +0300
Message-ID: <4DE70274FF4F4FF59DCC69B573961124@JukanPC>
To: "Sandra Reinhart" <sandrar82@gmx.de>, <www-validator@w3.org>
Sandra Reinhart wrote:

> Line 70, Column 20: document type does not allow element "div" here;
> missing one of "object", "applet", "map", "iframe", "button", "ins",
> "del" start-tag

You have there:

<div id="header"> <a href="http://www.frauenportal.net">
  <div class="logo"></div>
  <!--end: logo-->
  </a>
      <!--end: ad468x60-->
</div>

This looks pointlessly complicated, but the technical issue is that you have 
nested a <div> element inside an <a> element, which is forbidden in the 
declared syntax.

Fixing this issue by simple modification of HTML markup is probably 
difficult since you are, in effect, using an empty box as a link, apparently 
relying on a background image appearing in that box. A better approach, for 
several reasons, is to use a normal content image, and then you can use 
normal simple and valid markup like

<div id="header">
<a href="http://www.frauenportal.net"><img src="..." alt="..." 
border="0"></a>
</div>

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/ 
Received on Friday, 1 October 2010 20:34:34 GMT

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