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-->
      <!--end: ad468x60-->

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="..." 

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

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 14:18:02 UTC