I'm putting together a family tree website where each page will have an organizational flow chart for one family surrounded by pictures of the family members.
I'm using style='position:absolute'
with left and top coordinates to position the pictures on the page. Now I'm trying to add a caption to the bottom of each picture which will stay with the picture as I position it where I want it.
I tried different codes and methods, and found this code that works, but only if I delete the positioning code in the HTML. Once I include the positioning, the box with the caption just goes back to the upper left corner. The pictures are going to be strategically placed the page, so I need to positioning code.
Here's the code I found (courtesy of jsFiddle), which places a box around the picture and the caption below it:
CSS:
.image {
display: inline-block;
margin: 10px;
padding: 5px;
border: 10px solid white;
-moz-box-shadow: 0 0 5px #888;
-webkit-box-shadow: 0 0 5px#888;
box-shadow: 0 0 5px #888;
}
.image img, .image span {
display: block;
}
.image span {
text-align: center;
margin-top: 8px;
font-size: 12px;
font-family: arial;
HTML:
<div class="image">
<a href="Family tree_files/DSRM 2011.jpg">
<img alt="dsrm2011" src="Family tree_files/DSRM 2011.jpg"
style= "position: absolute; left:100px; top:85px;" width="208" height="461" /></a>'<span class=caption">Doug 2011</span>
Can someone help me code this so that the picture stays in the box with the caption where ever I position it?