doctypes
Document types
Doctype tokens declare parsing mode; modern sites use the HTML5 doctype.
HTML5 (living standard)
<!DOCTYPE html>
Declares the document as HTML and opts browsers into standards mode. Place exactly once, before the root <html> element.
Legacy modes (recognition only)
Older doctypes (XHTML 1.x, HTML 4.01) still parse as HTML documents today, but new projects should standardize on the single HTML5 doctype above. Quirks mode triggers come from missing or obsolete declarations—avoid relying on quirks.