Re: Alone tag

On 31-Dec-04, at 3:01 AM, Fabrice Deydier wrote:
> Hi Abyss,
>
> I have created 3 pages :
> http://www.my-industry.net/testhtml1.php
> It's a HTML 4.01 valid page. Look at the tags : <META>, <LINK> and the
> first <A>
>
> http://www.my-industry.net/testhtml2.php
> I have changed the tags with <META />, etc...
> The page is not HTML 4.01 valid !!! But it's XHTML 1.0 (transitional)
> valid.
That's since you have character data within the head element, namely a
less than sign. If you treat the document as XHTML then you don't. The 
/ closes
the tag. If you revalidate with the parse tree you can see what's 
happening.

> I note that the alone tags <IMG /> and <BR /> are correct.
<IMG /> is equivalent to <IMG>&lt; in HTML.

>
> http://www.my-industry.net/testhtml3.php
> I have closed the tags <META></META>, etc...
> The page is not HTML 4.01 valid : The V3C validator don't accept the 
> </META>
> and </LINK> tags.
That's since the end tag for META is forbidden. [1]
> But the <A></A> is correct !
That's since the end tag for A isn't forbidden, but required. [2]
> The page is XHTML 1.0 (transitional) valid.
>
> Well, I am suprised of the differences between the traitment of the
> <META>, <LINK>, <A> tags vs <IMG /> or <BR />.
The end tags for META, LINK, IMG and BR are forbidden but the end tag 
for A
is required. Also, META and LINK appear where character data is 
forbidden
but A, IMG and BR don't always.

[1]: http://www.w3.org/TR/html401/struct/global.html#h-7.4.4.2
[2]: http://www.w3.org/TR/html401/struct/links.html#h-12.2

Received on Friday, 7 January 2005 00:45:46 UTC