<!doctype html> needs to be <!DOCTYPE html> upper case capitals.
Thanks, but what is the difference?
<!DOCTYPE html> sets HTML5, lowercase is not a recognised tag and the browser defaults to quirks mode which can have unexpected results.
The truth of the matter is that there is no difference. Here's the spec on the HTML5 doctype. Notice that it specifically states that it is case-insensitive.
Using any case-insensitive version of that doctype will trigger "standards" mode in any reasonably modern browser. I did look it up and MS says that IE6 (and maybe IE7?) will not go into standards mode when the doctype does not have the URL included in it, like the HTML4 and XHTML doctypes had.
So capitalized or not <!DOCTYPE html> will trigger quirks mode in that/those browsers. On the other hand the IE6/IE7 "emulators" in IE11's developer tools have standards mode triggered with any capitalization. Go figure.
Still don't believe these authoritative sources? Try this:
<title>standards vs. quirks mode test</title>
<h1>standards vs. quirks mode test</h1>
<p>Change the case of the DOCTYPE statement to anything you want -- all caps, all lower case, CaMeL cAsE, some other mix. Save, open/refresh, click on the link below. If the alert states <b>CSS1Compat</b> that's "standards mode". If the alert states <b>BackCompat</b> that's "quirks mode".</p>
There is apparently one exception. If your HTML file will be processed or "serialized" somehow using XML, DOCTYPE must be capitalized. If not the parser will choke and throw an error. But if you are doing that you have more to worry about than capitalization. The document must also conform to XML syntax. In other words, no unclosed tags, e.g. <br> must be <br/>, no attribute "shorthand", e.g.<input type="text" required> must be <input type="text" required="required"> and more. I have a custom web app on a website that this actually factors in. It's a XML "database" that gets processed through a few XSL templates via PHP on the server. One missing self-closing slash crashes the whole thing.
Don't worry about it. If you want to live dangerously make it CaMeL cAsE. It'll still trigger standards mode.