How to create an image with a text description in HTML

Updated: 05/21/2018 by Computer Hope
creating image with html

Adding the title to the IMG SRC tag displays a message for the image as shown in the below code.

Example img HTML code

<img src="" alt="Computer Hope guy holding CH logo" title="Visit Computer Hope">

The above code displays "Visit Computer Hope" when a mouse hovers over the image in all browsers. In the above example, we also used the alt attribute to describe the image. Some browsers also use this attribute as the hover text. We recommend using the alt attribute to describe the image for search engines and the visually impaired and the title attribute for the hover text. Below is an example of the above code and as can be seen if you hover your mouse over the picture it displays the "Visit Computer Hope" message.


Computer Hope guy holding the CH logo