PDA

View Full Version : Lightbox image viewer: DOCTYPE problems



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

2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex4/lightbox2/index.htm

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"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

The only thing that works is no DOCTYPE. Strange.

:confused:

thetestingsite
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.

JackJack
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!

#outerImageContainer{
position: relative;
background-color: #fff;
width: 250px;
height: 250px;
margin: 0 auto;
margin-top:-40px;
}

:)

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


margin: 0 auto;
margin-top:-40px;

but can also be expressed:


margin: -40px auto 0 auto;