0

All, I know there are three types of DTD for HTML 4.01 (strict, transitional, and frameset). And I knew the DTD defines the syntax of markup constructs and the document structure with a list of legal elements and attributes.

So why is DTD missing in HTML 5? Isn't it necessary for HTML 5 document? Or no need to specify DTD for HTML5 because of only one DTD for HTML 5 by default ? Any special reason for removing DTD for HTML5?

Thanks

1 Answer 1

3

HTML5 is not an application of SGML, therefore it doesn't need an SGML DTD. I'm pretty sure that there are some things in HTML5 that are illegal in SGML, so even if you wanted to, you couldn't create an SGML DTD for HTML5.

4
  • I wonder how the HTML5 document been validated without DTD. Thanks.
    – Joe.wang
    Nov 20, 2014 at 11:54
  • 2
    There are several features in HTML5 that prevent the construction of a DTD for it; see cs.tut.fi/~jkorpela/html5-dtd.html for some notes. Nov 20, 2014 at 12:25
  • @Joe.wang, validators use ad hoc code for dealing with HTML5. They use schema-based parsing. Nov 20, 2014 at 12:26
  • @Joe.wang: it is validated against the HTML5 specification, not against an SGML schema. Mar 22, 2020 at 15:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.