DEV Community

Discussion on: The coding interview: !DOCTYPE

alohci profile image
Nicholas Stimpson • Edited on

DOCTYPE can't be removed from the standard unless all the old web pages that rely on it not being there are erased from the WWW. In many ways, the opposite is true. The way that browsers behave when faced with a HTML document that doesn't start with a DOCTYPE has been standardized. That's why the HTML5 spec doesn't refer to "quirks-mode", "almost standards mode" and "standards mode", but to "quirks mode", "limited-quirks mode" and "no-quirks mode", i.e. because all three are "standard".

It follows from that, that <!DOCTYPE html> at the start does not indicate a HTML5 document. In fact, a document that contains no DOCTYPE is also an (albeit invalid) HTML5 document, just one that will be rendered using quirks mode.