views:

41

answers:

1

Here is what I want to make, somehow:

1- A gradient background from top and down. There should be 2 colors, lets call them color1 and color2.

2- I want the gradient to be about one page, so it starts on top with color1, and then ends about one page down with color2.

3- Then I want color2 to continue all the way down for whatever size the page is.

Is this possible with css maybe?

Thanks

+5  A: 

You can create an image that is a couple pixels wide and whatever vertical length you want for your "page size".

In CSS, there's a way to control the repeating of an image. So, you could do a repeat-x, to get the image to repeat left to right. Then, just set the background color of your site to whatever the second color is, so that if your content extends further, the user will only see Color2.

e.g. CSS

body {
    background-color: #b5b5b5; /*gray*/
    background-image: url(./images/body_bg_gray_1380px.gif); /*path to wherever your bg img is...*/
    background-repeat: repeat-x;
}
kchau
You'd want it to be "repeat-x" instead of "repeat-y".
David
So, will this slow down the site, I mean, repeating around 30 images or whatever?
Camran
@Camran - No, it won't. You're not downloading X images, you're only downloading one image and displaying it X times.
JasCav