required HTML tags? (was RE: [thelist] Hiring Eye Opener - Web Skills Testing)

Liorean Liorean at user.bip.net
Thu Feb 28 07:46:00 CST 2002


At 18:39 2002-02-27 -0400, Marc Seyon wrote:
>Are there any HTML tags that are "required"? Other than TITLE...

Depends on what DTD you're using:

XHTML 1.0 Strict
----------------
<!ELEMENT html (head, body)>
<!ELEMENT head (%head.misc;,
      ((title, %head.misc;, (base, %head.misc;)?) |
       (base, %head.misc;, (title, %head.misc;))))>
<!ELEMENT body %Block;>

HTML 4.01 Strict
----------------
<!ENTITY % html.content "HEAD, BODY">
<!ENTITY % head.content "TITLE & BASE?">

<!ELEMENT HTML O O (%html.content;)    -- document root element -->
<!ELEMENT HEAD O O (%head.content;) +(%head.misc;) -- document head -->
<!ELEMENT BODY O O (%block;|SCRIPT)+ +(INS|DEL) -- document body -->




Which tells you that:
HTML 4.01 Strict let's you leave HTML, HEAD and BODY tags out, but requires
you to put one TITLE tag in the HEAD section, even if that tag is not in
the source, and one or more block element or SCRIPT tag in the BODY section.

XHTML 1.0 Strict on the other hand requires you to put html, head, and body
tag in the source, as well as a title tag in the head and one or more block
element in body.
// Liorean




More information about the thelist mailing list