Re: Alone tag

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:

Jukka "Yucca" Korpela,

Received on Friday, 31 December 2004 11:46:19 UTC