HTML 4 !doctype Tag
Also see HTML5
This page contains information about the HTML 4 version of this element. For a more up to date version, see HTML5
!doctype tag is used for specifying which version of HTML the document is using. This is referred to as the document type declaration (DTD).
The HTML 4 document type declaration starts off with
<!doctype html public, followed information on the HTML specification that the document conforms to.
HTML 4.01 has 3 possible doctypes: HTML 4 Strict, HTML 4 Transitional, and HTML 4 Frameset. Every HTML 4 document you create should have one of these three DTDs. The DTD you use will depend on how strict you want your HTML to be and whether you are using frames or not.
HTML 4 Strict
This document type includes all HTML elements except those that have been deprecated, and those that appear in frameset documents.
HTML 4 Transitional
This document type includes all HTML elements including those that have been deprecated.
HTML 4 Frameset
This document type includes all HTML elements in the transitional DTD as well as those in framed document.
HTML 5 uses a simplified
!doctype declaration (compared to previous versions). Here it is:
More about the HTML5 version here.
The information on this page is based on HTML version 4.01. Most modern browsers now support HTML5, which is the next version of HTML after HTML 4.01.
<!doctype> Tag for the HTML5 version of the above element.
Also see this list of HTML 5 tags for the latest version of HTML.