DOCTYPE HTML version of the statement

Foreword

And, like most of the students just learning HTML first time will understand the basic structure, the first sentence is <! DOCTYPE HTML> , most of the tutorial will explain this is used to declare the document type and version of HTML, deeper point there may learn HTML version of differences, but there are always speaking unclear where, today re-combing, the record it.

1. From the media type MIME Speaking

Media type (Internet media type, also known as MIME types ( MIME of the type ), or content type ( Content of the type )) is to the Internet classified on the type of content delivery given. --- Wikipedia

MIME type standard published by the IANA, was first used in SMTP e-mail protocol, the HTTP protocol WEB now also in use.

Naming format : Name Type / Sub-type name [; optional]

Media Type: Reference https://www.w3school.com.cn/media/media_mimeref.asp

Can be found in the reference manual, HTML is a sub-type TEXT types. Thus often seen in a request header in the Accept , Content-Type field (data representing the type of entity data transmitted Content-Type, Accept data representing the type of the client wishes to receive).

2. General Markup Language SGML standard

SGML is the definition of electronic documents and described the international standards. It stems from the document description language GML 1969, IBM developed, it is also an ISO standard.

MIME type: the Application / sgml, text / sgml

Extension Type: the HTML and XML similarly derived from it

3. HTML version differences

Before HTML5 version is based on the extension of SGML, DTD specifies the rules need to refer to markup language. So the old version of the DOCTYPE declaration will look very long. And HTML5 is not based on SGML, and therefore does not require reference DTD.

version statement
HTML 5 <!DOCTYPE html>
HTML 4.01 Strict <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

Guess you like

Origin www.cnblogs.com/dream08/p/11649636.html