html
  1. html-doctype-declaration

HTML DOCTYPE Declaration

A Document Type Declaration, or DOCTYPE, is an instruction to the web browser about the version of markup language in which a page is written.

The DOCTYPE declaration appears at the top of a web page before all other elements.

According to the HTML specification or standards, every HTML document requires a valid document type declaration to ensure that your web pages are displayed the way they are intended to be displayed.

How to Declare a DOCTYPE in HTML

Here is an example of how to declare a DOCTYPE in HTML:

<!DOCTYPE html>
<html>
  <head>
    <title>My Web Page (Additionalsheet.com)</title>
  </head>
  <body>
    <h1>Welcome to Additionalsheet.com!</h1>
    <p>This is some text.</p>
  </body>
</html>

The DOCTYPE declaration is usually the very first thing defined in an HTML document (even before the opening <html> tag); however, the DOCTYPE declaration itself is not an HTML tag.

Published on: