Reply to Re: closing the link tag in HTML strict

Your name:

Reply:


Posted by Jukka K. Korpela on 10/02/06 17:01

Scripsit petermichaux@gmail.com:

> When I validate a HTML 4.01 STRICT document it doesn't like to see a
> closed tag like this
>
> <link rel="stylesheet" href="base.css" type="text/css"/>

Of course it doesn't "like" it, since the ">" character data is invalid in
the context where the <link> element is allowed. What did you expect a
validator to do if not validate?

> Does anyone know why the link cannot be closed in HTML?

Of course the <link> element can and must be closed in HTML. It is
self-closing, i.e. no explicit end tag is allowed, since it has EMPTY
declared content. And you actually close the <link> _tag_ (and thereby the
<link> element, too) if you use that "/" character, but then you have a
problem with the subsequent ">". See
http://www.cs.tut.fi/~jkorpela/html/empty.html

> It seems
> strange if HTML 4.01 is supposed to be closely parallel with XHTML.

They are two different syntaxes. It is absurd to use one and expect it to
validate under the other.

Just don't mix good old HTML and XHTML, mm'kay? Actually, just don't put any
XHML on the web before at least the most common browser supports it, mm'kay?

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация