What is DOCTYPE in HTML5?

What is DOCTYPE in HTML5?

  • HTML
  • 1 min read

DOCTYPE, the first piece of a webpage, is the doctype line. In HTML5, it looks like this: <!DOCTYPE html>. This species that the webpage is written in HTML, and more particularly in the HTML5 dialect. If we do not specify it, the browser will just guess what version of HTML we are writing in.

Frequently Asked Question for DOCTYPE in Interviews

Question: What is the first markup element of every HTML5 webpage?

Answer: <!DOCTYPE html>

Note

The doctype declaration is not case-sensitive.

Browser Support

All modern browsers support HTML5 DOCTYPE declaration.

Related Tutorials:

  1. What are Validators? [HTML, CSS and JavaScript]
  2. HTML Template Example

Reference:

Introduction to HTML5