views:

108

answers:

3

For things like menubars and headers, a background color is nice.

But a background color that gracefully transitions from say Blue to White is even nicer.

I know this can be done by making a 1-pixel wide, X-pixel tall image file containing the desired fade and repeating it across the div, but does CSS have native support to just define colors and be done with it?

Can any other language handle this?

+1  A: 

You mean a gradient?

Webkit browsers(Chrome and Safari), and apparently FF 3.6 now support CSS gradients: see this link

According to the article, even IE has some proprietory CSS gradient support, I don't know how well that works though. You should always have a fallback to solid color though.

toby
A: 

take a look here link text

Puaka
+1  A: 

With CSS3, you can do that. However, CSS3 is not widely supported through browsers, so only the most recent of browsers (and not even all of them) will be able to display the gradient. Unless you're only interested in working with those browsers that can do it, you're going to have to stick with the 1px background image.

http://www.quirksmode.org/css/contents.html

http://www.w3.org/Style/CSS/current-work#CSS3

Jeff Rupert