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

Re: Problems with Markup Validation

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Thu, 2 Sep 2010 20:00:42 +0300
Message-ID: <22C53888C8344A869ACCB6A6DD2F0C5E@JukanPC>
To: "Sandra Reinhart" <sandrar82@gmx.de>, <www-validator@w3.org>
Sandra Reinhart wrote:

> I am the webmaster of http://www.frauenportal.net - I have several
> problems validating our design.

It’s not too bad—only 4 validation errors.

In general, it is best to work with validation errors sequentially, fixing 
the first one first, and so on. Quite often, one error spawns other error 
messages, which vanish in a puff of logic, when you fix the first error. 
Well, maybe not in this case, but generally.

The first message relates to line 53 and is caused by a homeless <li> 
element. An <li> element may only occur as a child of <ul> or <ol>. If there 
is no real list involved, use <span> or <div>, or just style an element like 
<a> directly.

> I do not understand the following error:
>
> Line 69, Column 20: document type does not allow element "div" here;
> missing one of "object", "applet", "map", "iframe", "button", "ins",
> "del" start-tag
>
>  <div class="logo"></div>

The reason is that the preceding tag is an <a> tag, so the <div> element 
would appear inside an <a> element, which is forbidden by syntax rules. You 
can change the <div> element to a <span> element to avoid the issue, but you 
may need to revise your CSS code accordingly.

> One possible cause for this message is that you have attempted to put
> a block-level element (such as "<p>" or "<table>") inside an inline
> element (such as "<a>", "<span>", or "<font>").

There it is - your block-level element is <div>.

Another type of error message is caused by the use of good old style <img> 
markup in a document that declares an XHTML doctype. If you play XHTML, then 
you need to ”self-close” so-called empty elements (elements with EMPTY 
declared content) using the ”/” character before ”>”: <img src="..." ... 
alt="..." border="0"/>

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/ 
Received on Thursday, 2 September 2010 17:01:38 GMT

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