HTML & CSS · Junior · Question 1 of 75
Why do HTML documents start with <!DOCTYPE html>?
- 1To load the browser's built-in default stylesheet
- ✓Correct answer: To enable standards rendering mode instead of quirks mode
- 3To declare the document encoding and the page language
Explanation
DOCTYPE is neither a tag nor a resource link. It tells the browser the page follows modern standards and switches on standards mode. Without it the browser falls back to quirks mode and emulates old browser bugs (for example, a different box model). The encoding is set by <meta charset="utf-8">, not by DOCTYPE.