< All the HTML Tags >

<!DOCTYPE>

Video Coming Soon...

  • doctype

    Tag Type

    metadata

    Tag Category

    metadata

    Defines the HTML version used for browser rendering and compatibility

    Viewed

    1

    Examples

    1

Definition:

The HTML <!DOCTYPE> tag is a declaration used to specify the version of HTML being used in a document. It ensures that the web browser renders the page correctly according to the specified HTML standard. In modern web development, the <!DOCTYPE html> declaration is used for HTML5, which simplifies document setup and ensures compatibility across different browsers. Though not a tag, it is an essential element in every HTML document, placed at the very beginning of the file to help define the document's structure and ensure proper interpretation by browsers.

Attributes:

None

Accessibility:

While the DOCTYPE itself doesn’t directly affect accessibility, using a proper DOCTYPE ensures that the page is interpreted correctly by browsers, which helps maintain semantic structure and improves accessibility for assistive technologies like screen readers.

Default <!DOCTYPE> Example:

This is the declaration <!DOCTYPE html> for HTML5 and is the most commonly used today.
<!DOCTYPE html>
<html>
  <head>
    <title>How do I use the HTML DOCTYPE tag?</title>
  </head>
  <body>
    Content
  </body>
</html>

Default <!DOCTYPE> Result:


Title Content

Community Examples:

Coming Soon…
Coming Soon…