I've always struggled to understand the difference between the "title" and "alt" attributes on images. What would the effect if, on the same image src, I attributed a different title to the alt....and would it make a difference to search engine bots. Any thoughts?
Alt is not meant to be used as a tool tip, or more specifically, to provide additional information about an image. The title attribute, on the other hand, is meant to provide additional information about an element. That information is displayed as a tooltip by most graphical browsers, though manufacturers are free to render title text in other ways. Good question, rep added!
Hello. The "alt" attribute is part of the HTML 4 specification. The "title" attribute is not. It was introduced in Microsoft browsers and so it ended being a kind of "de facto" standard, but its use should be deprecated. "Alt" was introduced in the specification to the effect of providing a textual description of the image when the browser was unable to display images (old times...) or the user had disabled the displaying of images to speed the downloading of pages (also old times...). Later, browsers added the capability of showing a hint when the mouse cursor passes over the image. See this page: SitePoint reference IMG
Also the text in "alt" will not be shown in Firefox when the mourse cursor passes over the image if that image can be displayed. But it will in IE.
Since when? To the contrary, its use is encouraged now that browsers use the title property properly.
The "title" text is displayed as a tooltip/caption for an image. The "alt" text is displayed when image display is turned off on a browser. For SEO purposes and text only browsers, the "alt" attribute is very important.
Sorry for the confusion. "Title" was not an attribute of the image tag in HTML 3.2, but it was of the anchor tag since HTML 2. It was recognized by Internet Explorer since version 4.0B1. The name "title" comes because it was supposed to be filled with the title of the linked document. The "alt" attribute belongs to the image tag since HTML 2, and it was in the HTML 3.2 Specification. It was recognized by Internet Explorer since version 1. See http://www.w3.org/TR/REC-html32 "Title" was added to the attributes of the image tag in the HTML 4.01 Specification, as part of the "coreattrs" attributes. This expands the use of the "title" attribute to many other tags. See: http://www.w3.org/TR/html4/struct/objects.html#h-13.2 Thanks, drhowarddrfine.
Thanks for all the info guys, really appreciate it. Just need to spend a bit of time adding titles to all my images now then (always wondered why nothing came up when you hovered over them in Firefox). I am guessing that you can add the title attribute to links as well then, to give a tool tip on those also?
I think best practise would be alt tags for images only and title tags for links. Alt for images is important to make a site barrier free and is helpful for SEO purposes, but I don't see any real use for titles on images as long as they aren't linked anywhere.