Skip to content

element-permitted-order

Reports children that are out of the order the parent requires (<thead> and <tfoot> before <tbody>, <head> before <body>, <summary> first in <details>).

The browser either reorders them or treats the later one as stray content, so the page shows something other than the order written.

To fix, put the children in the required order.

Reported
...
<table><tbody></tbody><thead></thead></table>
...
<a href="x"><img alt="logo" src="a"></a>
<a href="x">text</a>
...
angular:
lint:
rules:
element-permitted-order: warn # off (default), warn, error
html:
lint:
rules:
element-permitted-order: warn # off (default), warn, error
svelte:
lint:
rules:
element-permitted-order: warn # off (default), warn, error
vue:
lint:
rules:
element-permitted-order: warn # off (default), warn, error

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

Suppress one line with sudsy-disable-next-line element-permitted-order in a comment of the file’s language.

The same check in other tools. full: Sudsy reports what the upstream rule reports; partial: only part of it, as the last column says.

Tool Rule Match What differs
html-validate element-permitted-order partial the content model of html-validate (data/model.txt); elements that no model row names are not judged