Why do we need the tag after the declaration?


#1

Why do we need the tag after the declaration? This seems redundant. We tell the browser that it is dealing with an html file via the Doctype declaration; then we have to tell it again with the tag once it starts parsing the code? Can the function of tags not be passed off to the DTD?


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

The DTD is not HTML, but SGML. It tells the user agent that the root element of the document is <html></html>. The de facto namespace is HTML5. Other than that the declaration has no part in DOM.