No replies
andy.richin
andy.richin's picture
Offline
newbie
Last seen: 9 years 21 weeks ago
Timezone: GMT-4
Joined: 2011-04-04
Posts: 3
Points: 6

I am working with a lightbox which is set to the height of the browser window. Inside, the content is placed in the middle of the screen, and all images are the same height. I am looking to change the height of different images, thus re-positioning the content so it remains in the center. Here is the code I have been adjusting to try and allow it to center, based on the height of the image:

#fancybox-outer {
position:relative;
width:462px;
height:100%;
vertical-align:middle;
top:50%;
padding:0;
/*margin-top:auto;*/
/*margin-top:-25%;*/
left:519px;

}

So is it possible to automatically center each piece of content (an image and header) based on the image size without creating a <div> for each item? I hope I have asked this correctly and it all makes sense. If not, let me know how I can help you! Thanks.