title

The title attribute in HTML provides additional information about an element, typically displayed as a tooltip when the user hovers over it.

title attribute

The title global attribute provides advisory information about the associated element.

  • Usage: The title attribute is used for labeling elements such as <iframe>, data table controls, and <abbr> for expanding abbreviations. It is also applicable with <link rel="alternate"> for alternate stylesheets.

Syntax

index.html
<element title="text">

Example

The three primary web development technologies are HTML, CSS, and JavaScript.

index.html
<p>The three primary web development technologies are
<abbr title="Hypertext Markup Language">HTML</abbr>,
<abbr title="Cascading Stylesheets">CSS</abbr>, and
JavaScript.</p>

Accessibility concerns

The title attribute can present difficulties for:

  • Touchscreen device users
  • Keyboard navigation users
  • People relying on assistive technologies, such as screen readers or magnifiers
  • Individuals with limited fine motor skills
  • Users with cognitive impairments

See also

Conclusion

The title attribute provides supplementary information about an element, often shown as a tooltip. However, it can pose challenges for certain users, including those with disabilities or using assistive technologies. Developers should be mindful of its limitations for accessibility.