<!DOCTYPE> tag in HTML

<!DOCTYPE> declaration is must because it is an instruction to the web browser about what version of the markup language the page is written in HTML document.

Important Description

  • Always add the <!DOCTYPE> declaration to your HTML documents.
  • The <!DOCTYPE> declaration refers to a DTD in HTML 4.01, because HTML 4.01 was based on SGML.
  • The DTD specifies the rules for the markup language so that the browsers render the content correctly.

Example HTML5 Documents

<doctype> Tag Browser Support

Element Chrome Edge Firefox Safari Opera
<doctype> Yes Yes Yes Yes Yes

Important Notes

  • The <!DOCTYPE> declaration is NOT Case Sensitive.
  • The <!DOCTYPE> must not contain any content, and does not need a closing tag.

Common DOCTYPE Declarations

HTML 4.01 Strict


HTML 4.01 Transitional

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

HTML 4.01 Frameset

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

XHTML 1.0 Strict

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">

XHTML 1.0 Transitional

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

XHTML 1.0 Frameset

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "">


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "">

Advertise With Us

We offer sponsored posts and guest posts with do-follow links, back-links, and other advertising services, To advertise email us at ""

© 2021 GDATAMART.COM (All Rights Reserved)