Log in

View Full Version : Making Lightbox / Fancybox work with website



noiseordinance
06-30-2010, 10:49 PM
Hi there. I am working on a website that unfortunately was required to be centered horizontally and vertically using margin: auto in the body tag. This, as expected, is causing real nightmares with Lightbox variants as the do not properly center on the screen. However, when I remote margin: auto or change it to margin: 0, it centers perfect. Can anyone help me? I've been pulling my hair out for days on this.

Here's the code for the body:



body {
font: normal 12px/normal Arial, sans-serif;
color: #eaeaea;
background-color: #3D3A32;
width: 1100px;
height: 768px;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
padding: 0px;
border: none;
}

tomywie
07-07-2010, 09:26 PM
it should center when you do


margin: 0 auto;

http://www.w3schools.com/css/css_align.asp

darrenbang
08-08-2014, 07:59 AM
More about....CSS Div on center (http://www.corelangs.com/css/box/center-div.html)

darrang