HTML/CSSBeginner#html#doctype

What does the DOCTYPE declaration do?

<!DOCTYPE html> tells the browser to render the page in standards mode using HTML5 rules, rather than quirks mode which emulates old buggy browser behavior. It must be the very first line of an HTML document.

Example
<!DOCTYPE html>
<html lang="en">
<head><title>Page</title></head>
<body></body>
</html>

Related Questions

1
HTML/CSSIntermediate#html#doctype

What is quirks mode vs standards mode?

Open
2
HTML/CSSBeginner#html#meta

What are the important meta tags in an HTML document?

Open
3
HTML/CSSBeginner#html#meta

What does the viewport meta tag do and why is it needed?

Open