HTML DOCTYPE Declaration

Please log in or register to do it.
HTML DOCTYPE Declaration

Don’t Forget to Add a Doctype : Choosing the right doctype for your HTML documents!

DOCTYPE (Document type declaration) is a dictate that consociate a particular XML or SGML document with a document type definition (DTD)

The HTML DOCTYPE tag is given for defining which version of HTML the document is using in your webpage, this is relate to as the DTD (document type declaration).

You must see <! DOCTYPE> declaration very first in your HTML Document every Page, that is also can see before HTML tags.

DOCTYPE in older version of HTML was Longer because the HTML language was Based on SGML and hence mandatory a reference is to a DTD.

HTML5 would use simple syntax to prescribe DOCTYPE as follows.

<! DOCTYPE html>

On your PC if you see in your web browser like chrome or firefox just right click anywhere on the page except adds and then select “view page source” or easy way press short command Ctrl+U then you can see the source code of the page( in IE Ctrl+u doesn’t work, copy the code and paste in your Note pade and then if you see very first there is DOCTYPE even you can edit text or code whether you need.

HTML5 has grammar and Vocabulary.


Every page in your HTML5 document goes to <!DOCTYPE html>


<!DOCTYPE html> means this page  is written in HTML5 as defy to, say HTML 4.01 why, you ask, don’t they just write <HTML5> or even tang <!HTML5> I have perfectly no idea, better to go what they have contain before, here there is one general type of XHTML.

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “”>

HTML 4.01 consist three feasible DOCTYPE, they are in HTML4 strict, transitional and frameset. Any HTML document you can make these three any one of DTD (Document type declaration). These DTD depends on how strict you wish to use HTML and if you are using frames or not.

  • HTML 4 Strict: It is includes all HTML elements except those that have been remonstrate (deprecated) and those that appears in frameset documents.


  • HTML 4 Transitional: It is also includes all document type of html elements and including those that which is deprecated, and those that appear in frameset documents.


<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “”>
  • HTML 4 Frameset: This type of document includes all HTML elements in the transitional DTD  as well as those in framed document.


<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Frameset//EN” “”>

HTML Doctype Declaration <!DOCTYPE> :

There are different document types on the web already we have discussed about that html doctype declaration well, and the <!DOCTYPE> declaration aids the browser to expose a webpage in proper way. It disport a document correctly, the browser must grasp both type and version. The <!DOCTYPE> declaration is not delicate, all cases are acceptable.


<!DOCTYPE html>
<!doctype html>
<!Doctype Html>

Common Declarations:


<!DOCTYPE html>

HTML 4.01

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “”>


<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “”>
HTML Editors
HTML Introduction