The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Center div

Hi all,

I have page where I'm displaying thumbnail images which when clicked open the larger image in a previously hidden div which is made viewable by changing it's visibility and "floated" using the z-index property.

The div position is "fixed" at the top of the page when the page loads because it's placed right after the body tag. This page may have many thumbnails going down, so based on this and other content of the page there may be a scroll bar of indeterminable length.

What I am currently doing is displaying the div at a position relative to the thumbnail being clicked, but this does not work very nicely.

What I want to do is position the div in the center of the section of the page currently being viewed.

that will make "bottom" the bottom of the image on the entire page so just change the height of the div containing the big image to there. and ofcorse you can do a similer thing with left of the image just dont add the width to it.