HTML CSS Bootstrap Javascript Icons Python
HTML References
HTML - Tag Reference HTML - Tag by Category HTML - Attributes HTML - Global Attributes HTML - Events HTML - Language Codes HTML - Country Codes HTML - URL Encoding HTTP Methods HTTP Status Codes <input> types
All HTML Tags
<!-- --> <!DOCTYPE> <a> <abbr> <acronym> <address> <applet> <area> <article> <aside> <audio> <b> <base> <basefont> <bdi> <bdo> <big> <blockquote> <body> <br> <button> <canvas> <caption> <center> <cite> <code> <col> <colgroup> <data> <datalist> <dd> <del> <details> <dfn> <dialog> <dir> <div> <dl> <dt> <em> <embed> <fieldset> <figcaption> <figure> <font> <footer> <form> <frame> <frameset> <h1> - <h6> <head> <header> <hr> <html> <i> <iframe> <img> <input> <ins> <kbd> <label> <legend> <li> <link> <main> <map> <mark> <meta> <meter> <nav> <noframes> <noscript> <object> <ol> <optgroup> <option> <output> <p> <param> <picture> <pre> <progress> <q> <rp> <rt> <ruby> <s> <samp> <script> <section> <select> <small> <source> <span> <strike> <strong> <style> <sub> <summary> <sup> <svg> <table> <tbody> <td> <template> <textarea> <tfoot> <th> <thead> <time> <title> <tr> <track> <tt> <u> <ul> <var> <video> <wbr>

HTML <!DOCTYPE> declaration

The <!DOCTYPE> declaration is used for specifying which version of HTML the document is using.

The <!DOCTYPE> declaration must be the very first thing in your HTML document, before the <html> tag.

Run code

Browser compatibility

The <!DOCTYPE> declaration is fully supported by all browsers:

Element
<!DOCTYPE> yes yes yes yes yes



Common Document type declarations (DTDs)

There are three different <!DOCTYPE> declarations in HTML 4.01 − HTML 4 Strict, HTML 4 Transitional, and HTML 4 Frameset.

In HTML5 there is only one declaration.

HTML 4 Strict

This document type includes all HTML elements except those that have been deprecated, and those that appear in frameset documents:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
HTML 4 Transitional

This document type includes all HTML elements including those that have been deprecated:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
HTML 4 Frameset

This document type includes all HTML elements in the transitional DTD as well as those in framed document:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
HTML 5

In HTML5 there is only one declaration:

<!DOCTYPE html>

All HTML5 documents must start with a <!DOCTYPE html>
Tags: Reference

Last updated: Monday 17 Sep, 2018