SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot KarmaDungyu's Avatar
    Join Date
    May 2003
    Location
    Colchester
    Posts
    116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Centred wrapper doesn't line up with centred body background image

    Hi all, this one's a bit odd - I've got a background image on my body tag, which is set to 'center'. I've got a wrapper div which contains all my content, and that is set to sit centrally through the usual margin:auto. The design requires the wrapper div to sit 'correctly' over the body background image. However, they don't line up!

    Bizarrely, the wrapper div is sitting 2 or 3 pixels off to the right of the background image! Does anyone know why, in general, this might happen? Is there something that commonly does this? It's off in both Firefox and IE flavours, btw.

    I'll try to post the page to somewhere other than our closed dev server.

    many thanks in advance,

    Karmadungyu


    from the css:

    body {
    font-family:Verdana, Arial, Helvetica, sans-serif;
    font-size: 1em;
    color:#000000;
    text-align: center;
    background: url("/images/banana/bananarise_bak.jpg") repeat-x top center #faf28b;
    padding:25px 0 0 0;
    margin:0px;
    }
    #divWrapper {
    margin: 0px auto 25px auto;
    padding:0px;
    position: relative;
    width: 815px;
    background: url("/images/banana/wrapper_bak.jpg") no-repeat top right #FFFFFF;
    text-align: left;
    }
    Website Design : Chotrul Web Design and SEO

    Dharma Blog : Luminous Emptiness

  2. #2
    Function Curry'er JimmyP's Avatar
    Join Date
    Aug 2007
    Location
    Brighton, UK
    Posts
    2,006
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your code looks fine. Can we see the image you're using?

    Maybe your image is not sized correctly?
    James Padolsey
    末末末末末末末末末末末末末末末末末末末
    Awesome JavaScript Zoomer (demo here)
    'Ajaxy' - Ajax integration solution (demo here)

  3. #3
    SitePoint Zealot KarmaDungyu's Avatar
    Join Date
    May 2003
    Location
    Colchester
    Posts
    116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh god! ... what an idiot!

    the image is 2px off being centred ......

    (sound of man going out of room and shooting himself!)

    thank you so much!

    Karmadungyu
    Website Design : Chotrul Web Design and SEO

    Dharma Blog : Luminous Emptiness


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
  •