Why do you need to put “< !DOCTYPE html >” in capital letters?


#1

Why do you need to put “< !DOCTYPE html >” in capital letters?


FAQ: Learn HTML Elements - Common HTML Elements - The `<html>` tag
#2

We don’t need to, it’s just a habit many of us have grown into from earlier convention. HTML5 (like HTML4.01 and previous is not case sensitive.

XHTML is XML conforming and only lowercase tags and attributes are valid. HTML5 adopted this for the purpose of conforming when serving documents as ‘application-xml’.

Recall that anything outside of the root element (including the doctype) is NOT HTML, but SGML, the grand pappy of all markup languages of which HTML is a subset.


#3

Thanks mtf!

That makes sense!