Press "Enter" to skip to content

HTML Doctype declaration

HTML Doctype declaration

This is good practice for HTML documents that  start with a <!DOCTYPE> declaration. The HTML <!DOCTYPE>  is used to define which version of HTML the document is using .The DTD stand for document type declaration

 <!DOCTYPE>  tag is an information to the browser about what document type to expect.

Suggestion − The <!DOCTYPE> is an empty tag that does not have an end tag!.

Example for HTML Doctype declaration

<!DOCTYPE html>

<html>

<head>

<title>This is Doctype example</title>

</head>

 

<body>

All web page content.

</body>

 

</html>

In HTML5 there is only one declaration i.e.

<!DOCTYPE html>

Browser Support

Chrome

Firefox

IE

Opera

Safari

Android

Yes

Yes

Yes

Yes

Yes

Yes