Why an HTML image alt text doesn't show on hover

Updated: 12/31/2017 by Computer Hope

Unlike the Microsoft Internet Explorer browser, Mozilla Firefox, Google Chrome, and other browsers do not display the text used in the alt attribute when hovering over an image. The alt text is designed to display on the page when an image does not load, whereas the title text is designed to display balloon text for images that load. Firefox, Chrome, and other browsers (except Internet Explorer) follow the W3C standards for HTML, which states that an image should have title attribute for balloon text. For that reason, these browsers do not display the alt text on hovering over the image.

If you want balloon text to appear when the mouse hovers over an image, add "title" to the img HTML tag as shown in the example code below.

Example of alt text
Image with only alt tag
(does not show balloon text)

<img alt="Example of alt text" src="https://www.computerhope.com/logo.gif">

Example of alt text
Image with alt and title tag
(shows balloon text with mouse hover)

<img alt="Example of alt text" title="Example of title text" src="https://www.computerhope.com/logo.gif">

If you are using Mozilla Firefox or Google Chrome, the first example displays no balloon text with just the alt tag in the code. However, adding the title tag, as seen in the second example, displays balloon text when the mouse hovers over the image.