top of page

Why do we use HTML <!doctype> Tag

  • Writer: neha chaudhary
    neha chaudhary
  • Aug 1, 2018
  • 1 min read

The HTML <!doctype> tag is used for specifying which language and version the document is using. This is referred to as the document type declaration (DTD).

Syntax

The <!doctype> declaration is written as <!doctype> (no end tag) with the language being specified inserted within the tag. The <!doctype> declaration is case-insensitive (i.e. can be either uppercase or lowercase).

The <!doctype> declaration must go right at the top of the page, before any other HTML code.

Example:-

<!doctype html>

<html>

<head>

<title></title>

</head>

<body>

<p>Page content...</p>

</body>

</html>

 
 
 

Recent Posts

See All
Responsive vs. Adaptive vs. Mobile

Responsive and adaptive web design are closely related, and often transposed as one in the same. Responsive generally means to react...

 
 
 

Comments


© 2017 by Neha Chaudhary. 

bottom of page