Results 1 to 4 of 4

Thread: Lightbox image viewer: DOCTYPE problems

  1. #1
    Join Date
    Apr 2008
    Posts
    22
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Lightbox image viewer: DOCTYPE problems

    1) Script Title:
    Lightbox image viewer 2.03a

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...box2/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.


  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    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.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Apr 2008
    Posts
    22
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Found the problem in the CSS

    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;

    }


  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    This is fine:

    Code:
    margin: 0 auto;
    margin-top:-40px;
    but can also be expressed:

    Code:
    margin: -40px auto 0 auto;
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •