W3C home > Mailing lists > Public > www-validator@w3.org > December 2004

Re: Alone tag

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Fri, 31 Dec 2004 13:45:44 +0200 (EET)
To: Fabrice Deydier <fabrice@my-industry.net>
Cc: www-validator@w3.org
Message-ID: <Pine.GSO.4.58.0412311337340.4884@korppi.cs.tut.fi>

On Thu, 30 Dec 2004, Fabrice Deydier wrote:

> When I check a HTML 4.01 page with meta tag like this :
> <META blablabla>
> There is no problem.
> If I use <META blablabla></META> or <META blablabla />, the page is
> not valid.

That's because HTML 4.01 permits no end tag for a META element and no
plain text inside a HEAD element.

> There is the same problem with the <LINK blablabla> tag and the <A
> name="blabla"> tag.

No, with the A element the problem is different. For it, an end tag
is required, and you haven't written one.

> But, with <IMG blabla /> it's ok.

As far as validation goes, yes. It's equivalent to
<IMG blabla>>

> I don't understand the HTML 4.01 standard or it's a bug of the W3
> validator ?

The former.

The short answer to your problems: don't mix the XHTML concept of
"self-closing" tags with HTML 4.01. The META, LINK and IMG elements
need not have and must not have any end tag; forget the"/" before
">" (unless you move to XHTML for some odd reason).

Long answer: http://www.cs.tut.fi/~jkorpela/html/empty.html

Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/
Received on Friday, 31 December 2004 11:46:19 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:58:48 UTC