layout - CSS Newbie: Position a Div over Each of a Row of Photos -


i'm new css , racking brain on following:

i have row of images sourced database query. display photos in row wraps within page. example, if there 20 photos, display 5 per row based on width of page , photo.

my challenge: want position div in same relative spot on each photo. div contain link take action on photo. of action code working, cannot, life of me, correctly position div.

i can't post image of mockup i'm trying achieve (i'm new), here's description:

imagine row of photos size of postage stamp. in upper right corner of each, gray box containing link. i'm unable consistently position gray box in same relative position on each photo. each photo same size, since number of photos unknown, can't "position:abosulte;" action box manually.

my html looks follows: i've simplified loop; dump of query coldfusion of indeterminate number of photos.

<loop>      <div id="photo" style="display:inline;"><img src="abc"></div>     <div id="redbox" style="????"><a href="javascript:action(photo);">action</a></div>  </loop>    

thoughts?

many kind in advance.

maybe wrap in div?

<loop>     <div class="container" style="display: inline-block;">         <div class="photo"><img src="abc"></div>         <div class="redbox" style="position:relative; top: -20px; right; 10px;"><a href="javascript:action(photo);">action</a></div>     </div> </loop>   

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -