This is the information provided for the second step in the Learn HTML course:
<!DOCTYPE html> must be the first line of code in all of your HTML documents. If you don’t use the declaration, your HTML code will likely still work, however, it’s risky. For now, the browser will correctly assume that the html in
<!DOCTYPE html> is referring to HTML5, as it is the current standard.
In the future, however, a new standard will override HTML5. Future browsers may assume you’re using a different, newer standard, in which case your document will be interpreted incorrectly. To make sure your document is forever interpreted correctly, always include
<!DOCTYPE html> at the very beginning of your HTML documents.
In the first paragraph, it sounds like using
<!DOCTYPE html> just tells the browser to interpret the document using the current standard. In the second paragraph, it sounds like using the
<!DOCTYPE html> declaration ensures that your document “is forever interpreted correctly.” Which is correct?
Or is the
<!DOCTYPE html> declaration unique to HTML5 and other versions of HTML have different declarations?
Thanks for the help!