HTML <img> title Attribute

The title attribute on an <img> tag adds a tooltip with title text to the image.

Hovering the mouse over the image will display the tooltip.



A title attribute on an <img> tag.
Hover over the image to see the tooltip.

<img src="/img/html/vangogh.jpg"
     title="Van Gogh, Self-portrait.">

Code explanation

The title attribute is placed in the <img> tag.

The value can be any string.

Hover the cursor over the button and after a second a tooltip appears.

Using title

The title attributes attaches additional information to the <img> element.

The title attribute value can be seen as tooltip.

A tooltips is shown when the mouse hovers over the image.


<img title="value">



Value Description
value A string value.
A title can span multiple lines by including newline or carriage-return characters:  &#10;  or  &#013;.

Browser support

Here is when title support started for each browser:

1.0 Sep 2008
1.0 Sep 2002
1.0 Aug 1995
1.0 Jan 2006
1.0 Jan 2003

You may also like

 Back to <img>

Author: Jack Poorte
Published: Jun 20 2021
Last Reviewed: Sep 30 2023

Quick question: what's your favorite/least favorite part of Dofactory?