Skip to content

noObsoleteAttributes (HTML)

biome.json
{
"linter": {
"rules": {
"nursery": {
"noObsoleteAttributes": "error"
}
}
}
}

Disallow obsolete attributes on HTML elements.

The HTML specification marks these attributes as obsolete, so they should no longer be used. Browsers might ignore them or handle them differently from each other. Most of them changed how a page looks, which is now done with CSS. Others have a modern replacement, such as the id attribute instead of name on <a> elements.

Attribute names are case-insensitive. Elements inside <svg> and custom components in template languages, such as <Table />, are ignored.

<table bgcolor="#ffffff"></table>
code-block.html:1:8 lint/nursery/noObsoleteAttributes ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

⚠ The bgcolor attribute on <table> is obsolete.

> 1 │ <table bgcolor="#ffffff"></table>
│ ^^^^^^^^^^^^^^^^^
2 │

ℹ Obsolete attributes should no longer be used. Browsers might ignore them or handle them differently from each other.

ℹ Use CSS instead.

ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

<div align="center">Content</div>
code-block.html:1:6 lint/nursery/noObsoleteAttributes ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

⚠ The align attribute on <div> is obsolete.

> 1 │ <div align="center">Content</div>
│ ^^^^^^^^^^^^^^
2 │

ℹ Obsolete attributes should no longer be used. Browsers might ignore them or handle them differently from each other.

ℹ Use CSS instead.

ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

<a name="top">Back to top</a>
code-block.html:1:4 lint/nursery/noObsoleteAttributes ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

⚠ The name attribute on <a> is obsolete.

> 1 │ <a name="top">Back to top</a>
│ ^^^^^^^^^^
2 │

ℹ Obsolete attributes should no longer be used. Browsers might ignore them or handle them differently from each other.

ℹ Use the id attribute instead.

ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

<iframe src="/page.html" frameborder="0"></iframe>
code-block.html:1:26 lint/nursery/noObsoleteAttributes ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

⚠ The frameborder attribute on <iframe> is obsolete.

> 1 │ <iframe src="/page.html" frameborder="0"></iframe>
│ ^^^^^^^^^^^^^^^
2 │

ℹ Obsolete attributes should no longer be used. Browsers might ignore them or handle them differently from each other.

ℹ Use CSS instead.

ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

<table style="background-color: #ffffff"></table>
<div style="text-align: center">Content</div>
<a id="top">Back to top</a>
<iframe src="/page.html" style="border: 0"></iframe>
<input name="email" />
  • To disallow obsolete elements, such as <font> and <center>, see noObsoleteTags.