XHTML Doctrine Components and Their Existence

Recently, I started developing the client side using jQuery and JavaScript. Honestly, I always took the DOCTYPE tag for granted and I never read in it: http://www.w3schools.com/tags/tag_doctype.asp . I understand that there are different doctrines for XHTML 1 (total 3) HTML 4.01 (total 3) and HTML 5. The doctype type contains the following structure for the "HTML 4.01 Transitional":

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 

I do not understand the reason for the presence of: -//W3C//DTD HTML 4.01 Transitional//EN . Sure, is the DTD way enough? I also do not understand why it is so difficult to remember, for example. why not just say: W3C HTML 4.01 Transitional . I understand that there is a reason for this, but I can not find what it is.

I spent the last few hours searching for an answer, but no luck and therefore the reason for the question.

+5
source share
1 answer

HTML type declaration of a document is formally an SGML construct defined in the SGML standard (ISO 8879). Thus, the syntax follows this standard, which does not simply omit the public identifier; it allows you to use syntax only with a system identifier, in practice a URL, but then the syntax will be different. When HTML was defined, it would be better to use this syntax.

This does not matter in practice, because no browser has ever implemented HTML according to the book (according to the SGML standard), and browsers treat doctype lines in the same way as magic lines that can select a specific mode (quirks, standard, almost standard mode; co-call "sniping doctype"). In JavaScript, this does not matter; you can access the doctype string in javascript, but all of that.

+2
source

Source: https://habr.com/ru/post/1201495/


All Articles