Displaying img alt tag over div

Hello,

I have an image slide gallery (jquery cycle) with alt tags, covered with 2 divs for moving forward and back. It appears that since the div covers image, the image alt tag won’t be displayed when I hold the cursor over the image.

How could I solve this issue so that alt tag would show up normally like without divs?

Thanks for help

The alt attribute is only supposed to display when the browser can’t display the image and has nothing to do with the cursor. You are getting it confused with the title attribute which is some browsers produces a tooltip effect above whatever tag it is attached to. You should attach the title attribute to whichever tag is on top so that it can be properly displayed or alternatively generate the tooltip using Javascript so that it always appears as a tooltip (as some browsers put the title text into the status bar instead).

He’s probably working with Internet Explorer. IE6 and 7 display alt as a tooltip. Suffice it to say that using the alt attribute this way is wrong.

Same goes for the title attribute. It’s also wrong to assume that the title attribute is a mechanism for generating a tooltip. It’s simply more common in the case of title than it is for alt.

Thanks for explanation

I did mention that some browsers display it in the statusbar instead and that if you really want it displayed as a tooltip then you need to use JavaScript to create it.

To fix the IE bug you simply need to include title=“” in your images as well as the mandatory alt attribute. Then IE will behave the same as other browsers.