I'd like to make my CSS3 background gradient fixed. Any suggestions?
|
A way I have done it in the past was, within your css file set your background color to a solid color (example, #FFF). Create an gradient image that fades from red (top) to white (bottom), with a width of 8px and a height of 800px. Go back to your css file and add a background image attribute and point it to the gradient image you just created and set it to repeat horizontally. Now if someone has a screen resolution greater than 800 it will not matter because the white bottom of the image will fade in perfectly with the white background color you set. |
|||
|
|
An alternative that does not require image files is to use a
Hope this works. |
||||
|
|
|
Well, using CSS3 gradients you know that it will not work on IE at all. For IE you can use proprietary filters. But I'm supposing you are over this technical limitation, and really want to learn about truly CSS3 gradients. And by fixed I understand you want it to be the same gradient, independent of screen width and/or height. Let's say, it starts at 10px, and go to 500px. To achieve this effect, you should use the color-stops on the gradients. http://net.tutsplus.com/tutorials/html-css-techniques/quick-tip-understanding-css3-gradients/ Have fun. |
|||
|
|
|
I think you should just google for "CSS gradients". There are a lot of examples. Here I found a site, which explains well, how to use it. |
||||
|
|