• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Lack of interest using "title" instead of "alt" for Avatars ?

erich37

Well-known member
#1
why is XenForo using "ALT" instead of "Title" for Avatars and possibly in other places as well ?

I am using FireFox-browser and the "ALT-tag"-text is not showing up when browsing with FireFox.



I would suggest changing:
Code:
<img width="48" height="48" alt="EQnoble" src="data/avatars/s/1/1321.jpg?1367481160">

towards:
Code:
<img width="48" height="48" title="EQnoble" src="data/avatars/s/1/1321.jpg?1367481160">

:cool:



So for some images like the Forum-Node-icon, XenForo is using the "title-tag", which is showing fine in Firefox, like e.g. here:
Code:
<span class="nodeIcon" title="Unread messages"></span>
.... but for other images, XenForo is using the "alt tag", which is not showing up in FireFox.




http://www.computerhope.com/issues/ch001076.htm

http://stackoverflow.com/questions/872389/html-img-tag-title-attribute-vs-alt-attribute


:coffee:
 
Last edited:

erich37

Well-known member
#3
Google says it is perfectly fine to supplement the "alt" attribute with the "title" attribute.



This is the information provided directly by Google itself:

------------------------------

Update: Some of you have asked about the difference between the "alt" and "title" attributes. According to the W3C recommendations, the "alt" attribute specifies an alternate text for user agents that cannot display images, forms or applets. The "title" attribute is a bit different: it "offers advisory information about the element for which it is set." As the Googlebot does not see the images directly, we generally concentrate on the information provided in the "alt" attribute. Feel free to supplement the "alt" attribute with "title" and other attributes if they provide value to your users!


http://googlewebmastercentral.blogspot.com/2007/12/using-alt-attributes-smartly.html

------------------------------



So ideally, the best would be to add a "title"-attribute to the current "alt"-attribute.


:coffee:
 
Last edited:

Martok

Well-known member
#4
What's the point in using the "title" attribute to add a tooltip for avatars that shows the username when you can simply read the username under the avatar?

This is what it says about "alt" and "title" attributes here http://www.w3.org/wiki/Images_in_HTML


The alt attribute contains the text that should be displayed when the image is not available. The information in the alt attribute should not be displayed when the image was successfully loaded and shown; Internet Explorer gets this wrong, and shows it as a tooltip when you hover your mouse pointer over the image for a while. This is a mistake, as it leads a lot of people to add additional information about the image into the alt attribute. If you wanted to add additional information, you should use the title attribute instead, which I’ll get on to in the next section.

Adding nice-to-have information using the title attribute

Most browsers will display the value of an <img> element’s titleattribute as a tool-tip when you hover your mouse cursor over it (see Figure 2.) This can help a visitor learn more about the image, but you cannot rely on each visitor to have a mouse. The title attribute can be very useful, but it is not a safe way of providing crucial information. Instead it offers a good way to provide non-essential information, for example the mood of the image, or what it means in context
So Firefox is correct in not displaying the "alt" text as a tooltip.

Using the "title" attribute to display a tooltip containing the username offers no additional information as the username is already displayed on screen. As such the "title" attribute should not be used for avatars.

Also don't forget that tooltips can't be displayed on tablets or smartphones as they don't have a hover state.