Rule reference

This is a list of all built-in rules.

Rules with are enabled by html-validate:recommended.
Rules with are enabled by html-validate:document.

Additional presets can be found and compared in Configuration presets.

HTML Syntax and concepts

Rules relating to the HTML syntax and concepts.

attr-delimiter Disallow whitespace between attribute key and value
attr-spacing Require attributes to be separated by whitespace
close-attr Disallow end tags from having attributes
close-order Require elements to be closed in correct order
element-name Disallow invalid element names
form-dup-name Require form controls to have a unique name
map-dup-name Require `<map name>` to be unique
map-id-name Require name and id to match on <map> elements
no-dup-attr Disallow duplicated attributes
no-dup-class Disallow duplicated classes
no-raw-characters Disallow the use of unescaped special characters
no-redundant-for Disallow usage of redundant label for attributes
script-type Require valid type for `<script>` element
unrecognized-char-ref Disallow unrecognized character references
valid-autocomplete Require autocomplete attribute to be valid
valid-id Require `id` to be a valid identifier

Content model

attribute-allowed-values Validate permitted attribute values
attribute-misuse Require attribute to be used in correct context
element-permitted-content Validate permitted content
element-permitted-occurrences Validate permitted number of element occurrences
element-permitted-order Validate required element order
element-permitted-parent Validate permitted element parent
element-required-ancestor Validate required element ancestors
element-required-attributes Ensure required attributes are set
element-required-content Ensure required elements are present
input-attributes Validates usage of input attributes
no-multiple-main Disallow multiple `<main>`
script-element Require end tag for `<script>`
void-content Disallow void element with content


Rules related to usage of deprecated or obsolete functionality.

deprecated Disallow usage of deprecated elements
deprecated-rule Disallow usage of deprecated rules
no-conditional-comment Disallow usage of conditional comments
no-deprecated-attr Disallow usage of deprecated attributes


area-alt Require alternative text on `<area>` elements
aria-hidden-body disallow `aria-hidden` from being set on `<body>`
aria-label-misuse Disallow `aria-label` misuse
empty-heading Require headings to have textual content
empty-title Require title to have textual content
hidden-focusable Disallows `aria-hidden` on focusable elements
input-missing-label Require input to have label
meta-refresh Require meta refresh to have 0 second delay
multiple-labeled-controls Disallow labels associated with multiple controls
no-abstract-role Disallow usage of abstract WAI-ARIA roles
no-autoplay Disallow autoplaying media elements
no-implicit-button-type Disallow implicit button type
no-redundant-aria-label Disallow aria-label and label with same text content
no-redundant-role Disallow usage of redundant roles
prefer-native-element Prefer to use native HTML element over roles
svg-focusable Require <svg> to have focusable attribute
tel-non-breaking Require non-breaking characters in telephone numbers
text-content Require elements to have valid text content
unique-landmark Requires landmarks to have unique names
wcag/h30 WCAG H30: Providing link text
wcag/h32 WCAG H32: Providing submit buttons
wcag/h36 WCAG H36: Require alt text on images used as submit buttons
wcag/h37 WCAG H37: Using alt attributes on img elements
wcag/h63 WCAG H63: Using the scope attribute to associate header cells and data cells
wcag/h67 WCAG H67: Using null alt text and no title attribute on img elements
wcag/h71 WCAG H71: Providing a description for groups of form controls


require-csp-nonce Require CSP nonce for resources
require-sri Require SRI for resources


long-title Require title not to have too long text


attr-case Require a specific case for attribute names
attr-pattern Require attributes to match configured patterns
attr-quotes Require attribute quoting
attribute-boolean-style Require a specific style for boolean attributes
attribute-empty-style Require a specific style for empty attributes
class-pattern Require classes to match a specific pattern
doctype-style Require a specific case for DOCTYPE
element-case Require a specific case for element names
id-pattern Require IDs to match a specific pattern
name-pattern Require form control names to match a specific pattern
no-implicit-close Require elements with optional end tags to be explicitly closed
no-implicit-input-type Disallow implicit input type
no-inline-style Disallow inline style
no-self-closing Disallow self-closing elements
no-style-tag Disallow usage of <style> tag
no-trailing-whitespace Disallow trailing whitespace
prefer-button Prefer to use <button> instead of <input> for buttons
prefer-tbody Prefer to wrap <tr> inside <tbody>
void-style Require a specific style for closing void elements


These rules is to be used on full documents.

allowed-links Disallow link types
doctype-html Require usage of "html" doctype
heading-level Require headings to start at h1 and increment by one
missing-doctype Require document to have a doctype
no-dup-id Disallow duplicated IDs
no-missing-references Require all element references to exist
no-utf8-bom Disallow documents from having UTF-8 BOM


no-unknown-elements Disallow usage of unknown elements
no-unused-disable Disallow unused disable directives