Wells-it.com - Web Hosting

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

You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.

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
Moderator

He has: 1,912 posts

Joined: Sep 2003

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

demonhale's picture

He has: 3,301 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/

bja888's picture

He has: 902 posts

Joined: Feb 2004

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

bja888's picture

He has: 902 posts

Joined: Feb 2004

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