HTML global attributeGlobal attributes
title
Extra information about an element, usually shown as a tooltip.
- Applies to
- All HTML elements
Example
#HTML
<p>
Web pages are written in <abbr title="HyperText Markup Language">HTML</abbr>.
Hover over the abbreviation to see its expansion.
</p>Preview
Definition and usage
#The title attribute holds an additional description of the element. Most desktop browsers show it in a tooltip when you hover over the element and wait a moment.
Do not treat it as a place for important information. On phones and tablets the tooltip usually does not appear, and keyboard users will not see it either. Screen readers announce title inconsistently.
It works well as a supplement: the expansion of an abbreviation in <abbr>, a description of an <iframe>, or a hint on an icon that also has a visible or accessible label.
Syntax
#Syntax
<element title="additional description">…</element>Browser support
#Widely available
Works in all modern browsers, phones included. You can use it without worry.
- Chrome
- Edge
- Firefox
- Safari
Good practices
#- Do not repeat in
titlethe same text that is already visible. A screen reader may read it twice. - For icon-only buttons,
aria-labelis better thantitle.
Related entries
#Spotted a mistake or missing an example? Write to us.