Require usage of "html" doctype
- Rule ID:
- doctype-html
- Category:
- Document
- Standards:
- HTML5
HTML5 requires the usage of the <!DOCTYPE html>
doctype to prevent browsers
from guessing and/or using "quirks mode".
HTML5 also supports legacy strings for document generators but this rule disallows legacy strings as well.
This rule only validates the doctype itself not the presence of the declaration. Use missing-doctype to validate presence.
Rule details
Examples of incorrect code for this rule:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html SYSTEM "about:legacy-compat">
Examples of correct code for this rule:
<!DOCTYPE html>