HTML is an application conforming to International Standard ISO 8879 -- Standard Generalized Markup Language (SGML). SGML is a system for defining structured document types, and markup languages to represent instances of those document types. The SGML declaration for HTML is given in SGML Declaration for HTML. It is implicit among WWW implementations.
In the event of any apparent conflict between HTML and SGML standards, the SGML standard is definitive.
Every SGML document has three parts:
An SGML declaration, which binds SGML processing quantities and syntax token names to specific values.
Example: The SGML declaration in the HTML DTD specifies that the string that opens an end tag is </ and the maximum length of a name is 72 characters.
A prologue including one or more document type declarations, which specify the element types, element relationships and attributes, and references that can be represented by markup. An instance, which contains the data and markup of the document.
HTML refers to the document type as well as the markup language for representing instances of that document type.