Skip to content

doctype-html

Reports a doctype that is not <!DOCTYPE html> (compared without regard to case), such as the HTML 4.01 public identifier.

A doctype other than html puts the browser in quirks or limited-quirks mode, which changes how boxes, tables and images are sized.

To fix, use <!DOCTYPE html>.

Reported
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<title>x</title>
angular:
lint:
rules:
doctype-html: warn # off, warn (default), error
html:
lint:
rules:
doctype-html: warn # off, warn (default), error
svelte:
lint:
rules:
doctype-html: warn # off, warn (default), error
vue:
lint:
rules:
doctype-html: warn # off, warn (default), error

Enabled by the presets: html/html-validate-standard, html/htmlhint.

Suppress one line with sudsy-disable-next-line doctype-html in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
html-validate doctype-html full
htmlhint doctype-html5 full