57

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?

Wrikken
  • 69,272
  • 8
  • 97
  • 136
nectar
  • 9,525
  • 36
  • 78
  • 100

3 Answers3

73

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

whenov
  • 733
  • 1
  • 9
  • 19
Sarfraz
  • 377,238
  • 77
  • 533
  • 578
34

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 http://www.imagechicken.com/uploads/1275939952008633500.jpg

Title attributes can be applied to most HTML elements.

whenov
  • 733
  • 1
  • 9
  • 19
adrianbanks
  • 81,306
  • 22
  • 176
  • 206
11

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

Huseyin
  • 1,499
  • 2
  • 25
  • 39
Asaph
  • 159,146
  • 25
  • 197
  • 199