tags:

views:

221

answers:

4

I am displaying 5 userImage on one screen.I want to display userID and email on mouseover on those userImage.I used alt property of image control but that not working in mozila,chrome and some versions of IE. So what are the other better ways to display info on mouseover?

+1  A: 

Use the title attribute.

JYelton
Your link is for html tag (for setuping PAGE title), this have no common with a title attribute. Why you get +1 for this?
Svisstack
Oops wrong link; corrected.
JYelton
+1  A: 

The simplest way to get tooltips in most browsers is to set some text in the title attribute.

eg.

<img src="myimage.jpg" alt="a cat" title="My cat sat on a table" />

produces (hover your mouse over the image):

a cat

Title attributes can be applied to most HTML elements.

adrianbanks
@adrian but it displays all info in one line only what if - <img src="myimage.jpg" alt="a cat" title="My cat <br> sat on a table" />
nectar
@nectar: you cannot insert line breaks using this method - you have to leave it to the browser to insert line breaks where it thinks most appropriate.
adrianbanks
A: 

The title attribute works on most HTML tags and is widely supported by modern browsers.

Asaph
but it displays all info in one line only what if - <img src="myimage.jpg" alt="a cat" title="My cat <br> sat on a table" />
nectar
A: 

Use the title attribute while alt is important for SEO stuff.

Sarfraz
Your title link is not useable in this problem.
Svisstack
@Svisstack: you are right but fixed now.
Sarfraz
ALT's main importance is for accessibility to people with vision impairments.
Superstringcheese
+1 for alt info :)
Sarfraz
@Super, it is importnat actually, have a look at : http://www.seoworkers.com/seo-articles-tutorials/alt-attribute.html
Sarfraz
@sarfraz does `title` work in mozila nd chrome nd all versions?
nectar
@nectar: yes it works there too but you should be worried about browsers being used now by the masses.
Sarfraz
but it displays all info in one line only what if - <img src="myimage.jpg" alt="a cat" title="My cat <br> sat on a table" />
nectar
@nectar: That's how it will display, you can not control that or split it otherwise you will have to use some other fancy tooltip that you can search on google.
Sarfraz