Document Type Declaration (Doctype)

Web browsers can display several types of documents, not just HTML. So. when creating a web document the first thing you do is tell the browser what type of document is coming. You declare the type of document with a special line of HTML at the top of the document.

In technical terms, the document type is called the Document Type Declaration, or DTD for short. The doctype should always be the first item at the top of all your HTML files.

In prior versions of HTML, developers needed to constantly copy and paste the document type into the document because it was both long and complicated. With the release of the latest version of HTML, HTML5, the document type has been greatly simplified.


<!DOCTYPE html>

The first line of any HTML code is document type declaration.

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive