“<!DOCTYPE html>” What does it mean?

前端 未结 5 1182
别那么骄傲
别那么骄傲 2020-12-23 18:09

I use a fantastic javascript organization tree generator named \"ECOTree\" but the drawing does not work when I put . Labels in the boxes a

5条回答
  •  一向
    一向 (楼主)
    2020-12-23 18:31

    is not a "Document Type Declaration".

    A "Document Type Declaration" is an SGML concept for signalling the mark-up syntax and vocabulary for the mark-up that follows. does not conform to the requirements of that. This is unlike which is a SGML conforming Document Type Declaration.

    does not indicate an HTML5 document.

    Although HTML5 conforming documents in the text/html serialization are required to have at their start, it does not follow that the converse is true. I.e. a document can have at its start and not be an HTML5 document. For example, it is intended that all future versions of HTML will use the same character sequence at their start. So it might indicate an HTML5 document, or an HTML6, HTML7 etc. document, an HTML5+RDFa-lite document, or a document from an entirely competing standard.

    The HTML5 spec describes as "a required preamble", and that's much closer to the mark.

    It's just the shortest character sequence that will request to legacy as well as future browsers that the browser should handle the HTML of the document using its most modern HTML processing mode. It was chosen as the conforming preamble for HTML5 for solely that reason.

    If it can be said to have any meaning at all, it is that it indicates that the document was created or last refactored around about 2007 or later. Again, the converse does not necessarily apply. A document not containing does not imply that the document was created before any particular date.

提交回复
热议问题