tags:

views:

50

answers:

3

Hi there!

I was playing around with an image on a site just for practice, and I was wondering if anyone could help me with a question.

I am trying to get the branch the snake is on extend both directions. (using background-repeat for x) However it will only match up with one side or the other. Is there a way to get x to repeat only for one side of the image, so I can use two slivers of the tree image and it will match on both sides?

Thanks for any input or insight you might have!

+3  A: 

How would that work? Imagine an image as being a sequence of characters xyz.

To repeat the image I need to use:

xyz,xyz,xyz,xyz

Unless the sides of the image (the x and the z) match, there's no way to repeat it without getting mismatches at the boundaries between repeats.

In other words, fix your image so that the sides match up.

Dominic Rodger
Yes, I suppose I didn't think that was really going to work. Thanks for your advice!
Tracy
+1  A: 

No, you can't specify this.

What you should do is split your page in 3 zones: snake, left, right. Then use different repeating backgrounds for left and right.

You could also fix the snake image so it matches up.

marcgg
Oh, nice! Thanks so much for your help! Forgive the beginner question :)
Tracy
A: 

You can use background-position xpos ypos to set the starting point of the background. Move it up to coincide with the picture of the snake.

Matt Ellen