2013-02-26 74 views
0

我無法得到此漸變從左到右。目前它從上到下。垂直漸變

background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(166, 230, 230)), color-stop(0.33, rgb(231, 231, 231)), color-stop(0.15, rgb(255, 255, 255))); 

我試着cahnge左上角,左下角左,右,但然後什麼都沒有顯示出來。請幫忙。

回答

1

只需使用-webkit-linear-gradient形式:

background-image: -webkit-linear-gradient(left, rgb(166,230,230) 0, rgb(255,255,255) 15%, rgb(231,231,231) 33%); 

http://jsfiddle.net/45PQd/1

或者,如果你真的想使用更加詳細的格式,使用left top, right top

background-image: -webkit-gradient(linear, left top, right top, from(rgb(166, 230, 230)), color-stop(0.33, rgb(231, 231, 231)), color-stop(0.15, rgb(255, 255, 255)));