Technically, to parse and display a page correctly, a browser needs to know the DOCTYPE type of HTML document which tells the browser which version of HTML it should expect in the document.
Before HTML5, DOCTYPE declaration refers to a DTD, because it was based on SGML. The DTD specifies the rules for the markup language, so that the browsers render the content correctly.
HTML5 is not based on SGML, and therefore does not require a reference to a DTD. So HTML5 simplifies the
//In HTML5 <!DOCTYPE html>
in comparison to more complex declaration used before till HTML 4:
//BEFORE HTML5, Till HTML 4.0.1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
DOCTYPEdeclaration is NOT case sensitive.
Please remember that DO NOT leave any spaces before the DOCTYPE tag else even a single space may cause errors in browser rendering of the HTML5 code.
Happy Learning !!