Image Attributes

This HTML Tutorial demonstrates how to incorporate two important image attributes, the alt attribute and the title attribute.

ALT Attribute

The alt attribute is an essential inclusion with any image because some browsers, especially now with mobile phone browsers, disable images. The Alt attribute provides a text alternative when an image becomes available due to broken links or because the user has disabled images on their browser. The only accepted exception to the use of alt tags is when images are only used for presentational purposes on a website, i.e. layouts which when disabled, the alternative text provides no significant benefit to the user and actually detracts from the main content of the website.

TITLE Attribute

The title attribute is an interactive portion of HTML which on most browsers, displays a floated text box when a user hovers their mouse over an image. This additional information is often called a "tool tip".

Search Engines

Google and other search engines use the information provided in alt and title attributes to help rank your content. W3C Guidelines recommend all images contain an alt tag with information, even if the alt tag is blank (i.e. alt="") usually applied to presentational images.

 


Hover over the images below to test the titles.

Turn off images in your browser to view the alternative text.

 

laptop
Attribution: Dan Barbus
iPhone
Attribution: Robert Scoble
server
Attribution: Matthias Rosenkranz