[thelist] are <FONT> tags depreciated?

Steven Champeon schampeo at hesketh.com
Fri Jun 30 17:00:36 CDT 2000


on Fri, Jun 30, 2000 at 04:43:35PM -0400, Erik Sabowski wrote:
> according to w3.org, <head> and </head> are optional. but then it goes
> on to say that "Every HTML document must have a TITLE element in the
> HEAD section." This would make it sound like you are required to have a
> <head>. So basically, i'm just as confused as you are. maybe it's a case
> of browsers not being as strict as they should be with HTML errors, or
> maybe it's actually legal. can anyone else shed some light on the
> subject?

Back in the old days, when HTML was still an SGML application, there
was a concept called "optional open and close tags". Because TITLE
could only appear inside a HEAD, and BODY and HEAD could only occur
inside HTML, it stands to reason that

<TITLE>some title</TITLE>
<P>example</P>

is a complete HTML document, with implicit HTML, HEAD and BODY tags.
The world changed, the documentation didn't. It's still sane to consider
a HEAD section that doesn't use tags to delimit itself, as the HEAD is
quite simply whatever it contains (in this case, the TITLE). Using colons
to demonstrate the above more clearly,

:HTML:
:HEAD:<TITLE>some title</TITLE>:/HEAD:
:BODY:
<P>example</P>
:/BODY:
:/HTML:

The only place a TITLE is allowed is the HEAD. The only place anything
else actually present in the document is allowed is the BODY. The only
place HEAD and BODY are allowed is in the HTML container, so they can
be left out - as it is clear from the context which is the head and which
the body and what constitutes the entire document.

Of course, in SGML, you can specify optional/required open/close tags
for any element, by way of the DTD. In HTML, because it isn't /really/
an SGML application (or, to be more precise, it's a bastardized SGML
application that violates several fundamental rules of SGMLness, such
as separation of presentation from structure or content), it's up to the
browser whether leaving out a "required" tag causes problems. I still
have tables on my personal site that use single table cells inside single
table rows and don't use </td>, because it was redundant. In HTML4.01
strict, that'd be illegal, as it would be in XML or XHTML. It's strictly
a political decision - designed to make tools and browser vendors less
tolerant of broken and stupid markup - and has little to do with any
technical basis.

According to the HTML 4.0 Transitional DTD, the mozilla.org site is
invalid, but not because it lacks a TITLE. It's invalid because it
contains no DOCTYPE declaration, doesn't escape ampersands in GET
strings used as anchor URLs, etc.

Steve

-- 
http://a.jaundicedeye.com/weblog/
because it just annoys people when I talk to myself...




More information about the thelist mailing list