Google Chrome background-gradient

rickyduck picture rickyduck · Jul 22, 2011 · Viewed 43.1k times · Source

Really amateur question here - body background-gradient isn't working in chrome, very strange, I've tried:

background: -webkit-gradient(linear, 0 0, 0 bottom, from(#FFF), to(#000));

And

background: -webkit-gradient(linear, 0%, 0%, 0%, 100%, from(#fff), to(#000));

And

background: -webkit-gradient(linear, center top, center bottom, from(#fff), to(#000));

All to no avail! Works in every other browser...

Answer

robertc picture robertc · Jul 22, 2011

Have you tried:

background: -webkit-linear-gradient(#917c4d, #ffffff);

WebKit updated to match the spec syntax, so you should have this to get maximum browser support:

background: -webkit-gradient(linear, center top, center bottom, from(#917c4d), to(#ffffff));
background: -webkit-linear-gradient(#917c4d, #ffffff);
background: -moz-linear-gradient(#917c4d, #ffffff);
background: -o-linear-gradient(#917c4d, #ffffff);
background: -ms-linear-gradient(#917c4d, #ffffff);
background: linear-gradient(#917c4d, #ffffff);