View Full Version : Lightbox image viewer: DOCTYPE problems

05-16-2008, 11:44 PM
1) Script Title:
Lightbox image viewer 2.03a

2) Script URL (on DD):

3) Describe problem: If I use a defined DOCTYPE, the image viewer goes to the hard left, not centered. I even tried this DOCTYPE from Dynamic Drive:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

The only thing that works is no DOCTYPE. Strange.


05-17-2008, 04:03 AM
Please post a link to the page on your site that contains the problematic script so we can check it out.

I have been able to successfully integrate lightbox into a webpage using a standard doctype. There may be something else on your page that is causing this issue wih your page.

05-17-2008, 07:53 PM
I spent some time validating the CSS style sheet page and found the problem; #outerImageContainer Value Error : margin only 0 can be a length. You must put an unit after your number : -40 auto 0 auto

I thought I had coded correctly and moved the margin up { margin: -40 auto 0 auto; }. That was incorrect. Below must be the correct way, because it works with the DOCTYPE above!

position: relative;
background-color: #fff;
width: 250px;
height: 250px;
margin: 0 auto;


05-18-2008, 02:37 AM
This is fine:

margin: 0 auto;

but can also be expressed:

margin: -40px auto 0 auto;