PDA

View Full Version : Fading with CSS?


netfrugal
05-03-2007, 12:35 PM
I am using an image as a background, which is a simple fading from a darker color to a lighter color from top to bottom. Just something to make the left column look nice.

But it is limited to the height of the image.

Can css create a fading background color from top to bottom?

I've looked around, and can't get a simple tutorial on it.

thanks!

Marc

<h1>
05-03-2007, 12:45 PM
unfortunately css cannot do this. But, when you say "it is limited to the height of the image", there is a workaround for this: background positioning.
eg:

.menu {background: #eee url(images/myback.jpg) repeat-x top left}


Click here for more info (http://www.w3schools.com/css/css_background.asp)

BonRouge
05-03-2007, 11:35 PM
You could try this one: http://www.alistapart.com/articles/supereasyblendys/

themanwhowas
05-04-2007, 11:03 AM
i have seen php generated css gradients before, which work ok but the pages take longer to load as you end up with like hundreds of lines of css at the top of each page.
i found an example, check out http://www.designdetector.com/demos/css-gradients-demo-1.php
and take a look at the source code. 254 lines of css and 254 divs using them. and that to your current page content and you got yourself a party

themanwhowas
05-04-2007, 11:09 AM
also, i hear that the new css will support gradients. Can't remember where i heard this but i have faith