html.doctype
- Default
- error
- Plugin
html
A page starts with <!doctype html>.
Why: Without the doctype, browsers render the page in quirks mode, which changes the layout and can hide content.
When off: pages without a doctype pass.
<!-- ✗ Fails -->
<html lang="en">
...
</html>
<!-- ✓ Passes -->
<!doctype html>
<html lang="en">
...
</html>
References
- HTML spec: The DOCTYPE: A document must start with a DOCTYPE.
- MDN: Quirks mode and standards mode: Without
<!doctype html>, browsers render the page in quirks mode.