What is DOCTYPE in HTML5?

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>


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


Introduction to HTML5

Leave a Comment