tags:

views:

38

answers:

2

Hello All:

I have one multiple div which have one image in right top corner as background. I want to give some information (like title). Can any body tell how this can be achieved in case of background image.

Thanks, Ashwani

+1  A: 

You have to give the element that has the background image a title.

Something like:

<div style="background-image:url(image.gif);" title="image"></div>
digitalFresh
But, in that case the whole element will show the title. But, I want to show title only when we hover mouse on the image (corner). Any suggetions
Ashwani K
@Ashwani K: Not possible without extensive and unnecessary code.
animuson
:(, hmm. any other idea?
Ashwani K
@Ashwani K: The only other way is to create an element the exact size of the image, and put a title on that. I suggest you make it an img element instead. Why would you need a title for a bg?
digitalFresh
Our designer did this :(
Ashwani K
A: 

A background image shouldn't convey any information, thus no need for a title (btw do you mean the title attribute on some element or a heading Hn?).

If you want to add a title, then you should use an img element with a correct alt that IE will incorrectly display as a tooltip. The title attribute should add complementary information, you'd better use the alt attribute alone.

Felipe Alsacreations