SiteLint documentation and guidelines

Obsolete attribute found.

Description

Obsolete HTML attributes are attributes that have been deprecated and removed from the HTML specification. These attributes may still work in some browsers but are not guaranteed to be supported in the future. Using obsolete attributes can lead to accessibility issues, inconsistent behavior across browsers, and difficulties in maintaining and updating web content.

Disabilities Impacted

  • Visual impairments: users with visual impairments who rely on assistive technologies may not receive proper support for obsolete attributes, leading to incomplete or inaccessible content.
  • Cognitive disabilities: users with cognitive disabilities benefit from clear, consistent, and modern web practices. Obsolete attributes can lead to confusion and a degraded user experience.
  • Motor impairments: users with motor impairments who navigate using keyboards or other assistive devices may encounter inconsistent behavior when interacting with elements using obsolete attributes.

Why it matters

Obsolete HTML attributes are those that were previously used in HTML specifications but have since been removed or replaced. This means that they might not be supported in all browsers, especially future versions, leading to unpredictable behavior and potential security vulnerabilities.

Many obsolete attributes were found to create barriers for people using assistive technologies (like screen readers) to access the web. For example, the border attribute on tables was used to specify border widths but could also confuse screen readers, making it harder for visually impaired users to understand the table structure.

Modern HTML emphasizes semantic markup, meaning using tags that describe their purpose rather than just their presentation. Obsolete attributes often relate to presentation rather than structure or semantics, which can lead to confusion for both browsers and assistive technologies.

Obsolete attributes can provide incorrect or confusing information to screen readers and other assistive technologies, making it harder for users with disabilities to understand and navigate web content.

Coding problems and solutions

Examples of obsolete attributes and their replacements

The align attribute

Used for alignment of elements. Replace with CSS.

Incorrect example
<div align="center">Centered text</div>
Correct example
<style>
  .text-center {
    text-align: center;
  }
</style>

The bgcolor attribute

Used to set background color. Replace with CSS.

Incorrect example
<table bgcolor="green"></table>
Correct example
<style>
.primary-color {
  background-color: yellow;
}
</style>

How to Fix It

  • Use CSS for styling: replace obsolete styling attributes with CSS.
  • Use modern HTML attributes: replace obsolete attributes with their modern equivalents where applicable.
  • Ensure semantic HTML: use semantic HTML elements and attributes to ensure better accessibility and maintainability.

Known limitations

  • Legacy browser support: some legacy browsers may still support obsolete attributes, but this is not a reason to continue using them. Focus on modern web standards.
  • Transition period: transitioning from obsolete attributes to modern practices may require a period of adaptation and learning. You can also use polyfills for that purpose.
  • Testing: ensure thorough testing across different browsers, devices, and screen readers to verify that replacements are functioning as expected.

Resources

Rule

  • Audit: Accessibility.
  • Standard: SiteLint.
  • Level: Best Practices.
  • Success Criteria: Not applicable.
  • ID: obsolete-attribute-found