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), t开发者_运维技巧o(#000));
All to no avail! Works in every other browser...
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);
CSS3 linear-gradient tag is now supported by all major browsers.
The syntax requires an additional to
. Therefore instead of e.g. center top
, left top
etc use e.g. to top
like
background-image: linear-gradient(to top , #094F86, #4EABDB);
Have you tried this:
<style>
.myawesomegradient{
background:-webkit-gradient(linear, left top, right top, color-stop(0%,#ffffff), color-stop(100%,#000000));
}
</style>
Should work in Safari and Chrome ...
Like you, I had a problem with the Chrome browser, but the only solution is to use inline styles! style = "" Write the your code here to solve the problem
精彩评论