HTML Tags – DOCTYPE Tag


What is a DOCTYPE in html ?

DOCTYPE should be declared first before entering the HTML tags.

DOCTYPE is not a html element or a tag.

DOCTYPE is used to provide instructions to the web browser about what version of HTML the page is written.

DOCTYPE is supported in all the browsers.

How to declare DOCTYPE ?

DOCTYPE declaration differs from versions of documents created by the user.

Syntax :

<!DOCTYPE html>

Example


<!DOCTYPE html>
<head>
  <title></title>
  ...
</head>
<body>
  ...
  ...
</body>
</html>

HTML coding for a website !!!

Click to Learn More about – HTML Tutorial for beginners

For HTML 5

<!DOCTYPE html>

For HTML 4.01 Strict

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

For HTML 4.01 Transitional

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

For HTML 4.01 Frameset

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

For XHTML 1.0 Strict

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

For XHTML 1.0 Transitional


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

For XHTML 1.0 Frameset

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

For XHTML 1.1

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

Browser Compatibility

SnoBrowserSupport
1ChromeYes
2FirefoxYes
3EdgeYes
4OperaYes
5SafariYes
6Internet ExplorerYes


8 comments

  1. Hi my friend! I want to say that this post is awesome, great written and include almost all vital infos. I would like to see more posts like this . Connie Adelbert Dahl

Comments are closed.