How do I center the body bg image?

Discussion in 'CSS' started by Fracisc, May 24, 2011.

  1. #1
    I have this code:
    body {background: #ffffff url('./images/body.png') no-repeat;  font-size:16px; font-family:Arial, Helvetica, sans-serif;color:#666; margin:0 auto;padding:0; }
    Code (markup):
    I can't find a way to center that background image. I need it to be 100% width and the exact width is to big so I can't add it as numbers..

    Any idea?
     
    Fracisc, May 24, 2011 IP
  2. Bapinder

    Bapinder Well-Known Member

    Messages:
    151
    Likes Received:
    7
    Best Answers:
    3
    Trophy Points:
    120
    #2
    Try this:

    body {background: #ffffff url('./images/body.png') no-repeat center;  font-size:16px; font-family:Arial, Helvetica, sans-serif;color:#666; margin:0 auto;padding:0; }
    Code (markup):
     
    Bapinder, May 24, 2011 IP
  3. secretdesign

    secretdesign Well-Known Member

    Messages:
    797
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    155
    Digital Goods:
    3
    #3
    And that's it. ;)
     
    secretdesign, May 24, 2011 IP