Do all XHTML documents require a doctype?
-
Yes
-
No
Reveal answer
Fill a bubble to check yourself
A
Correct answer
Explanation
Yes - all XHTML documents must include a DOCTYPE declaration to be valid. The DOCTYPE tells the validator and browser which DTD to use for validation and rendering. Without it, the document is not valid XHTML.
AI explanation
Yes — the XHTML specification requires every conforming document to declare a DOCTYPE (e.g., XHTML 1.0 Strict/Transitional/Frameset) because XHTML is defined as an XML application, and XML processors need the DOCTYPE to identify the document type and associated DTD for validation. Without it, the document isn't a valid XHTML document per the W3C spec, so 'No' is incorrect.