View Full Version : break circle of dependence of absolute positioned elements

10-24-2007, 09:42 PM
"Hello World"
I've made a gallery in css. If the server is online check my projects under http://www.lafeijoa.de/home The main menu is positioned absolute in a circle in the center. Beeing on the photo page on the left are the thumbnails, also positioned absolutely. Clicking a thumb the real image should be shown in front of all and positioned absolutely in the center of the WINDOW! But if the width of the thumb gallery is only 200px and not about the width of the full window how do I get it into the center of the window? (I use this "position-50-50%-margin:-half of imagesize"-method)
So the question is how to get out of the vicious circle of the dependence of one absolute positioned element to his parent element?

<div style="position:absolute;width:200px;">
<a href="#" style="background:url(thumb.jpg);"><img /><em style="background:url(image.jpg);"></em></a>
<!-- OnClick em will be shown and image will be loaded -->

Please help! I need a solution working on every browser!

greetings from Berlin

PS: idea by Stu Nichols ( http://www.cssplay.co.uk )

10-25-2007, 12:00 PM
you could look into the "lightbox" it creates a new layer on the page and opens the image / slideshow.

10-29-2007, 09:14 PM
Thank you boogieman, but I am looking for a method in css without the use of JavaScript!