0

我正在寻找一种从“无”(alpha)到定义颜色的线性渐变:#e6a015。我在谷歌和这里都找不到它,有人能告诉我怎么做吗?

4

1 回答 1

1

您可以使用 alpha 为零的 rgba 颜色

background-image: -ms-linear-gradient(top left, rgba(230,160,21,0) 0%, rgb(230,160,21)  100%);

/* Mozilla Firefox */ 
background-image: -moz-linear-gradient(top left, rgba(230,160,21,0) 0%, rgb(230,160,21) 100%);

/* Opera */ 
background-image: -o-linear-gradient(top left, rgba(230,160,21,0) 0%, rgb(230,160,21) 100%);

/* Webkit (Safari/Chrome 10) */ 
background-image: -webkit-gradient(linear, left top, right bottom, color-stop(0, rgba(230,160,21,0)), color-stop(1, rgb(230,160,21)));

/* Webkit (Chrome 11+) */ 
background-image: -webkit-linear-gradient(top left, rgba(230,160,21,0) 0%,rgb(230,160,21) 100%);

/* W3C Markup, IE10 Release Preview */ 
background-image: linear-gradient(to bottom right, rgba(230,160,21,0) 0%, rgb(230,160,21) 100%);

演示

于 2013-03-04T02:04:32.597 回答