I am creating a web page which currently looks like the following image:
What I am trying to do now, is replace the grass image with two or more alternating background images. These images must be repeating in the x direction. Example:
The gray background and the gradient between the grass and the gray background can be ignored.
All background images are 260x650
pixels in size and the number of images is static.
What I have tried, is creating a background like this:
background: url('bg1.png') 0 0 no-repeat, url('bg1.png') 260px 0 no-repeat
The problem is I cannot set repeat-x
, because there has to be a margin of 260px
between the images. This answer to other question states there is no such margin.
I would prefer not to combine the images in a single image.
My resources are plain JavaScript, CSS and HTML. My target browsers are relatively new(IE 9, but preferrably 8), so don't worry about old quirks.