Anybody know how to do a gradient color shift in a background?

They have: 27 posts

Joined: Feb 2005

Ive seen it in alot of other sites, but can't find the html code to do a gradient color shift in a background. If anyone know how to do this, please let me know .
thanks

teammatt3's picture

He has: 2,102 posts

Joined: Sep 2003

It can't be done in html, only in an image editor.Smiling

demonhale's picture

He has: 3,278 posts

Joined: May 2005

yeah look for a gradient bg image strip and put it in your background command in html...

r3a1's picture

He has: 28 posts

Joined: Aug 2005

like teammatt3 said ... this isn't done in code, it is done with a graphic as a background.

What you need to do is create a strip (depending on horizontal or vertical) being very large in the direction you want (I use something in range of 1500x10). Then you use that strip in your background and let it tile thus creating the effect. I would use CSS to do this because if you end up with a user with an enormous screen res. then they will see the image stop (like in my example, might go two far down thus the image stops after 1500), so you solve this by declaring a default color background to the last color in your gradient so it just looks like it fades out to that final color. I'm not sure if I did the best job explaining this so if you have any more questions let me know. I'm guessing you are looking for something similar to this (functionally) http://www.cis.ksu.edu/~ryand/portfolio/

They have: 5,633 posts

Joined: Jan 1970

Very nice portfolio but dont use 1500 X 10. Insted try 1500 X 1. Same effect and you dont have to load another 13500 pixles.

SearchBliss's picture

He has: 267 posts

Joined: Feb 2005

bja888 wrote: Very nice portfolio but dont use 1500 X 10. Insted try 1500 X 1. Same effect and you dont have to load another 13500 pixles.

Unfortunatly a lot of image editing programs won't let you use 1 pixel, but the least is best.

r3a1's picture

He has: 28 posts

Joined: Aug 2005

and thus I learn a bit in the process as well ... Thanks bja888

They have: 5,633 posts

Joined: Jan 1970

I have never had any troubles creating a 1px image. Like which programs are u talking about?

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.