I'm working on several projects with HTML, and sometimes I forget to put <!DOCTYPE html>
. Will it make any big or noticeable changes?
The <!DOCTYPE>
declaration must be the very first thing in your HTML document, before the tag.
The <!DOCTYPE>
declaration is not an HTML tag; it is an instruction to the web browser about what version of HTML the page is written in.
A lot of IDEs allow users to leave this out and default to a certain HTML style, but leaving it out does pose a potential threat in browser compatibility and the use of older versions of HTML.
For example: new features & tags in HTML5 such as <article>
,< footer >
, <header>
,<nav>
, <section>
may not be supported if the <!DOCTYPE>
is not declared.
Additionally, the browser may decide to automatically go into Quirks or Strict Mode.