DOCTYPE In HTML

HTML <!DOCTYPE> Declaration

In HTML you must declare the document type at very first line before the <HTML> tag . The <!DOCTYPE> declaration tell to the web browser about the version of HTML on this page you used.

In each version of HTML the Declaration of Document type is different. For example

<!DOCTYPE> in HTML 5

In HTML 5 we declare the document Type as:

<!DOCTYPE html>

<!DOCTYPE> in HTML 4.01 Strict

in HTML 4.01 Strict we can use all HTML elements and attributes. One restriction is that we can not include any presentational elements. In this version Framesets are not allowed. The document type declaration for HTML 4.01 Strict is as follow:

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

<!DOCTYPE> in HTML 4.01 Transitional

In This version we can use all HTML elements and attributes, INCLUDING presentational and deprecated elements (like font). Framesets are not allowed. The document type declaration for HTML 4.01 Transitional is as follow:

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

 <!DOCTYPE> in HTML 4.01 Frameset

In This version we can use all HTML elements and attributes, INCLUDING presentational and deprecated elements (like font). In this version we cal also use The Framesets. The document type declaration for HTML 4.01 Frameset is as follow:

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