Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image Map Captions? 1

Status
Not open for further replies.

DaProgrammer

Programmer
May 27, 2004
22
US
Dear All,
Im sure that this can be done, but I am wanting to make an image and on certain coordinates, input data from an XML file across the web. I know how to insert the XML data into anywhere on the page, but i do not know how do this over an image at designated coordinates. PLEASE HELP!

Thanks,
DaProgrammer

"As a circle of light increases, so does the circumference of the darkness around it." - Albert Einstein
 
I think this can be done using CSS. If you position a <span> element absolutely, it should work:

Code:
<style type="text/css">
span.imgcaption {
position: absolute;
left: x;
top: y;
}
</style>
.............
<span class="imgcaption">Your caption</span>

This should work if your browser is able to use absolute positioning. Since it is absolute, you can put it anywhere in the body as long as it is within a block element.

opinion {
inline-styles: are-messy;
internal-stylesheets: waste-space;
external-stylesheets: are-bliss;
}
 
I am unfamiliar with CSS. Could you give me a bit more of an idea or an alternative?

THANKS MUCH,
DaProgrammer
 
OK! Scratch that last one as i have figured it out partially. I can get the caption on the image, but if i put the Span statement after the image it is nolonger in it. So, it has to be before. In that case, however, I am unable to adjust the text, without adjusting the image. Help??!?

-Thanks,
Eric
 
Can you post a URL to the page with the problem or post some code?

opinion {
inline-styles: are-messy;
internal-stylesheets: waste-space;
external-stylesheets: are-bliss;
}
 
Heh... Sorry. For the left: x; and the right: y;, I meant you should put x and y values in for each text element.

Example:

Code:
span.imgcaption {
position: absolute;
left: 100px;
top: 50px;
}

This means:

Position any span element with a class of "imgcaption" absolutely 100 pixels from the left side of the screen and 50 pixels from the top of the screen.

Hope that helped a bit more!

opinion {
inline-styles: are-messy;
internal-stylesheets: waste-space;
external-stylesheets: are-bliss;
}
 
Ok, but two things:

1. How do i add more items in different positions?
2. By declaring a designated position, won't it change when in different screen resolutions?

Thanks
 
1. span.imgcaption1 {...

2. No. The positions of the items will stay the same. I did notice however that your image is centered. This will cause a problem with absolute positioning.

Perhaps someone with more experience (vragabond, HELP!) can assist you.

opinion {
inline-styles: are-messy;
internal-stylesheets: waste-space;
external-stylesheets: are-bliss;
}
 
Dear All:

Problem solved. Here's an interesting (yet simple) method to do what I was wanting. Take a table and fill it with cells. You can merge where needed to expand data area. Then simply put the image you want as a background. I hadn't thought of that until recently. Thank you though for your help though gohankid77 (a star for you to).

-Eric
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top