css - 垂直渐变

扫码查看

我无法获得从左到右的渐变。目前,它是自上而下的。

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左上,左下到左,右,但是什么都没显示。请帮忙。

最佳答案

只需使用-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)));

10-02 02:05
查看更多