Is HTML case sensitive?

Solution 1:

No, but it's considered good practice to keep HTML markup lowercase.

Solution 2:

From http://www.w3.org/TR/html5/syntax.html

In other words, <!DOCTYPE html>, case-insensitively.

Many strings in the HTML syntax (e.g. the names of elements and their attributes) are case-insensitive, but only for characters in the ranges U+0041 to U+005A (LATIN CAPITAL LETTER A to LATIN CAPITAL LETTER Z) and U+0061 to U+007A (LATIN SMALL LETTER A to LATIN SMALL LETTER Z). For convenience, in this section this is just referred to as "case-insensitive".

Solution 3:

In addition to the other answers given, if you set the header Content-type: application/xhtml+xml, your browser will throw and XHML error if you don't type DOCTYPE in uppercase and html in lowercase:

<!DOCTYPE html>

Using the XHTML content type isn’t recommended because the page won't be rendered in some browsers (e.g. IE8 and below), but it's certainly interesting to know.

Source: http://blog.whatwg.org/xhtml5-in-a-nutshell

Solution 4:

HTML is case insensitive. XHTML, that is being XML is case sensitive.