What is DOCTYPE in HTML?

The <!DOCTYPE> declaration tells the browser which version of HTML the page uses, so it can show the page in the correct way. In HTML5 it is very short, and it must be the first line of the page.

<!DOCTYPE html>
<html lang="en">
  ...
</html>

It is not an HTML tag and it is not case-sensitive. In HTML 4 the doctype was long and had a link to a DTD file. HTML5 removed all that. See HTML Page Structure.


Learn more about the similar topics:
Tutorials
HTML Introduction
HTML First Program using Notepad
HTML Page Structure
Exercises & Assignments
Steps to Create a Webpage in HTML using Notepad
Write an HTML program to display hello world.
Write an HTML program to create a page about yourself
Interview Questions & Answers
What is the full form of HTML?
What is DOCTYPE in HTML?
Will HTML5 work without DOCTYPE?
How is the page structure of HTML5 different from previous HTML versions?
What is HTML?
What is the HTML page structure? Explain with example