position text precisely on top of an image

How do I position some text precisely on top of an image? I don't want to use absolute positioning relative to the browser window, but positioning relative only to the image. So if the image moves, the text maintains its position within the image.
LVL 11
SweatCoderAsked:
Who is Participating?
 
Gurvinder Pal SinghConnect With a Mentor Commented:
try set the positioning of a block (div) as absolute, with the image as its background image and the text as its content
0
 
SweatCoderAuthor Commented:
How do I set a background image on a div? I want the div to be exactly the same size as the image so that the image entirely covers it.
0
 
Gurvinder Pal SinghCommented:
<< How do I set a background image on a div? >>
you can set the background image of almost any element. please check
http://www.w3schools.com/css/css_background.asp

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.