Search code examples
cssgoogle-chromelinear-gradients

Google Chrome background-gradient


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...


Solution

  • 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);