# List of rules

> A complete list of all the rules for HTMLHint

## Doctype and Head

[Section titled “Doctype and Head”](#doctype-and-head)

* [`doctype-first`](doctype-first/): `<doctype>` must be declared first.
* [`doctype-html5`](doctype-html5/): `<doctype>` must be HTML5.
* [`head-script-disabled`](head-script-disabled/): The `<script>` tag cannot be used in `<head>` tag.
* [`html-lang-require`](html-lang-require/): The HTML lang attribute is required.
* [`meta-charset-require`](meta-charset-require/): `<meta charset="">` must be present in `<head>` tag.
* [`meta-description-require`](meta-description-require/): `<meta name="description">` with non-blank content must be present in `<head>` tag.
* [`meta-viewport-require`](meta-viewport-require/): `<meta name="viewport">` with non-blank content must be present in `<head>` tag.
* [`link-rel-canonical-require`](link-rel-canonical-require/): `<link rel="canonical">` with non-blank href must be present in `<head>` tag.
* [`script-disabled`](script-disabled/): `<script>` tags cannot be used.
* [`style-disabled`](style-disabled/): `<style>` tags cannot be used.
* [`title-require`](title-require/): `<title>` must be present in `<head>` tag.

## Attributes

[Section titled “Attributes”](#attributes)

* [`alt-require`](alt-require/): The alt attribute of an img element must be present and alt attribute of area\[href] and input\[type=image] must have a value.
* [`attr-lowercase`](attr-lowercase/): All attribute names must be in lowercase.
* [`attr-no-duplication`](attr-no-duplication/): Elements cannot have duplicate attributes.
* [`attr-no-unnecessary-whitespace`](attr-no-unnecessary-whitespace/): No spaces between attribute names and values.
* [`attr-sorted`](attr-sorted/): Attributes should be sorted in order.
* [`attr-unsafe-chars`](attr-unsafe-chars/): Attribute values cannot contain unsafe chars.
* [`attr-value-double-quotes`](attr-value-double-quotes/): Attribute values must be in double quotes.
* [`attr-value-no-duplication`](attr-value-no-duplication/): Attribute values should not contain duplicates.
* [`attr-value-not-empty`](attr-value-not-empty/): All attributes must have values.
* [`attr-value-single-quotes`](attr-value-single-quotes/): Attribute values must be in single quotes.
* [`attr-whitespace`](attr-whitespace/): No leading or trailing spaces in attribute values.
* [`button-type-require`](button-type-require/): The type attribute of a button element must be present with a valid value: “button”, “submit”, or “reset”.
* [`form-method-require`](form-method-require/): The method attribute of a form element must be present with a valid value: “get”, “post”, or “dialog”.
* [`input-requires-label`](input-requires-label/): All \[ input ] tags must have a corresponding \[ label ] tag.

## Tags

[Section titled “Tags”](#tags)

* [`empty-tag-not-self-closed`](empty-tag-not-self-closed/): The empty tag should not be closed by self.
* [`frame-title-require`](frame-title-require/): A `<frame>` or `<iframe>` element must have an accessible name.
* [`h1-require`](h1-require/): A document must have at least one `<h1>` element.
* [`href-abs-or-rel`](href-abs-or-rel/): An href attribute must be either absolute or relative.
* [`main-require`](main-require/): A document must have at least one `<main>` element in the `<body>` tag.
* [`src-not-empty`](src-not-empty/): The src attribute of an img(script,link) must have a value.
* [`tag-no-obsolete`](tag-no-obsolete/): Disallows the use of obsolete HTML tags.
* [`tag-pair`](tag-pair/): Tag must be paired.
* [`tag-self-close`](tag-self-close/): Empty tags must be self closed.
* [`tagname-lowercase`](tagname-lowercase/): All HTML element names must be in lowercase.
* [`tagname-specialchars`](tagname-specialchars/): Tag names can only contain letters, numbers, ”-”, ”:” or ”\_”.
* [`tags-check`](tags-check/): Allowing specify rules for any tag and validate that

## ID

[Section titled “ID”](#id)

* [`id-class-ad-disabled`](id-class-ad-disabled/): The id and class attributes cannot use the ad keyword, it will be blocked by adblock software.
* [`id-class-value`](id-class-value/): The id and class attribute values must meet the specified rules.
* [`id-unique`](id-unique/): The value of id attributes must be unique.

## Inline

[Section titled “Inline”](#inline)

* [`inline-script-disabled`](inline-script-disabled/): Inline script cannot be used.
* [`inline-style-disabled`](inline-style-disabled/): Inline style cannot be used.

## Formatting

[Section titled “Formatting”](#formatting)

* [`space-tab-mixed-disabled`](space-tab-mixed-disabled/): Do not mix tabs and spaces for indentation.
* [`spec-char-escape`](spec-char-escape/): Special characters must be escaped.