Re: Repeat-x and Repeat-y

Mary Morris wrote:
> 
> Can someone give me an example of how repeat-x and/or
> repeat-y should work? I don't see any examples, and I'm
> not sure what the syntax would be in the long string.
> Can I specify both repeat-x and repeat-y or must I
> specify both.

You cannot specify both repeat-x and repeat-y. You have to choose one of
the keywords from the set repeat (default), repeat-x, repeat-y and
no-repeat.

Here is an example:

    BODY { background: blue url(wave.png) 0% 100% repeat-x fixed }

This creates a blue background with a wave along the bottom of the
window that stays there if you scroll the text.

Another one:

    BODY {background: white 90% 5% url(images/logo) no-repeat}

This puts a single copy of the logo near the upper right corner.

> 
> For example, what if I want to repeat an image twice down
> the left side of the screen and have it fixed (so that something
> on the background lines up with text)?

That is not possible in CSS1. You can either have a single copy of the
image, a single horizontal band, a single vertical band, or a fully
tiled background. Two copies of the image, or two bands is not currently
possible.

What you could do in the example you gave is to create a new image that
contains two copies of the original:

    BODY {background: url(2copies.png) fixed repeat-y}

When you say that the background should line up with the text, what
exactly do you mean? Note that when the background is declared `fixed',
it is fixed to the window, not to the text.


Bert

Received on Monday, 18 November 1996 11:44:04 UTC