# Linter Rule: Avoid using the `title` attribute **Rule:** `html-no-title-attribute` ## Description Discourage the use of the `title` attribute on most HTML elements, as it provides poor accessibility and user experience. The `title` attribute is only accessible via mouse hover and is not reliably exposed to screen readers or keyboard users. ## Rationale The `title` attribute has several accessibility problems: - It's only visible on mouse hover, making it inaccessible to keyboard and touch users - Screen readers don't consistently announce title attributes - Mobile devices don't show title tooltips - The visual presentation is inconsistent across browsers and operating systems Instead of relying on `title`, use visible text, `aria-label`, `aria-describedby`, or other accessible alternatives. ::: warning Exceptions This rule allows `title` on ` ``` ### 🚫 Bad ```erb
Content
* ``` ## References - [HTML: `title` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title) - [WebAIM: Accessible Forms](https://webaim.org/techniques/forms/) - [ARIA: `aria-label` attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-label) - [ARIA: `aria-describedby` attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-describedby) - [erblint-github: GitHub::Accessibility::NoTitleAttribute](https://github.com/github/erblint-github/blob/main/docs/rules/accessibility/no-title-attribute.md)