Positioning a repeating (x) background image

Discussion in 'HTML & Website Design' started by maizey, Mar 15, 2006.

  1. #1
    Hi there,

    I'm trying to position a background image (starting 756 pixels from the left) which is repeating horizontally - but of course am running into problems because as soon as you repeat-x an image repeats the whole screen, not taking into account background positions.

    Does anyone have any ideas how I can possibly avoid this?!

    The only thing I can think of is to create a huge image to factor in for all screen solutions, and just not repeat it at all. I'd prefer not to do it this way as firstly it's not very clean, and secondly it will result in a large file size.

    Here is a link to the background image to show you what I'm talking about:
    http://joshsphotos.com/images/bg.jpg

    I've also put in the CSS that would show what I'm trying to achieve.

    
    body {
    background-image: url(../images/bg_repeat.jpg);
    background-position: 756px 0px;
    background-repeat: repeat-x;
    }
    
    Any help would be most appreciated.
    
    Code (markup):

     
    maizey, Mar 15, 2006 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
    kk5st, Mar 15, 2006 IP
  3. vectorgraphx

    vectorgraphx Guest

    Messages:
    545
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #3
    wow gary, how did you spot that??!??! you must have some sort of super-powered x-ray vision or something :D
     
    vectorgraphx, Mar 16, 2006 IP
  4. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #4
    :) I visit several forums. I thought I had seen it before, and a check verified it. I ran into the post again over on DevShed forums, so that's three. There are people working redundantly on the other two.

    cheers,

    gary
     
    kk5st, Mar 16, 2006 IP