liveBook · Manning

Title attribute

As explained in Web Design Playground, Second Edition

The HTML title attribute supplies advisory text that browsers may display as a tooltip for an element.

The title attribute adds optional advisory text to an HTML element. Browsers may show its value as a tooltip when the pointer hovers over the element. section 6.1 section 16.1

Use title when a short hover hint adds useful context:

  • Add it to an image to describe the logo or other hover text. section 6.1
  • Add it to an abbreviation to provide the full term or acronym expansion. section 16.1

A title on an image and an abbreviation

<img src="/images/atomic-logo.png" alt="Atomic Web Design logo" title="Logo for Atomic Web Design"> <abbr title="fear of missing out">FOMO</abbr> Hover over either item to see the browser’s tooltip. section 6.1 section 16.1

How Web Design Playground, Second Edition covers it

How deep it goes
Defines the attribute and demonstrates two uses, but stops short of discussing browser differences or advanced accessibility guidance.
Examples
Uses a company-logo image and the abbreviation FOMO to demonstrate hover text and term expansion.
What you can do after
Apply it via HTML to add image tooltips and abbreviation expansions.
How it connects
Connects HTML attributes with images, alternative text, abbreviations, acronyms, and tooltips.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Web Design Playground, Second Edition. The section links point to the parts of the book it draws on.