Since when did HTML make this change to itself?


#1

I learned HTML for the first time in 2007. Back then, I borrowed a book from the library on HTML and Cascading Style Sheets, and one thing I remembered was that the HTML document began with

<html>

</html>

Nowadays, we have to begin with

<!DOCTYPE html>
<html>

</html>
</html>

Since when did HTML make this change? Why?


#2

@programmeranonymous,

Do a google search
== discussions / opinions ==
html since when is doctype used site:stackoverflow.com
= http://stackoverflow.com/questions/3147799/why-do-we-need-doctype-to-the-html-jsp-pages


#3

<!DOCTYPE html> has been around for a while, could be the book decided to skip it. Maybe, in 2007 you would have needed this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
                "http://www.w3.org/TR/html4/strict.dtd">

for doctype deceleration.


#4

You don't need two </html>s at the end as the doctype tag doesn't need closing.