: The DOCTYPE Declaration
Last updated: 2026-09-12
<!doctype>The DOCTYPE Declaration
Declares the document type so the browser knows which HTML version to use. It must be the first line of an HTML document and appear exactly once. Modern pages use <!DOCTYPE html> to switch to standards mode.
| Category | Document Structure |
|---|---|
| Content Model | Before everything, before |
| Allowed Parents | Any element that accepts flow content |
| Content Tag | Self-closing — no closing tag needed |
| Status | Standard |
📝 Syntax
<!DOCTYPE html>
▶ Example
Edit the code below and see the live result in the playground:
🌐 Browser Support
| Browser | |||||
|---|---|---|---|---|---|
| <!doctype> | ✓ v1 | ✓ v12 | ✓ v1 | ✓ v1 | ✓ v1 |
| Supported in all major browsers | |||||
Tip: DOCTYPE is not an HTML tag but a declaration; omitting it triggers quirks mode with inconsistent rendering.
🏷️ Related Tags
💡 Related Cases
More case studies coming soon — check back later.