无法弄清楚这个旧的webkit CSS3渐变

时间:2012-07-20 12:22:21

标签: css3 webkit gradient

所以,我发现这个整洁的代码对CSS3有一些渐变效果,但只有旧的webkit语法。

我正试图让它在其他浏览器中运行,但我无法弄清楚如何将其转换为正确的语法。

这是代码:

background: -webkit-gradient(linear, left top, right top,
      color-stop(0%,rgba(221,221,221,1)),
      color-stop(50%,rgba(221,221,221,0.01)),
      color-stop(100%,rgba(221,221,221,1))
);

background: -webkit-gradient(linear, left top, right bottom,
    color-stop(0%,rgba(0,0,0,.1)),
    color-stop(85%,rgba(255,255,255,0.01)),
    color-stop(100%,rgba(255,255,255,.35))
);

1 个答案:

答案 0 :(得分:0)

第一个是:

background-image: linear-gradient(left top,
                                  rgba(221,221,221,1) 0%,
                                  rgba(221,221,221,0.01) 50%,
                                  rgba(221,221,221,1) 100%
                                  );

我将第二个作为练习留给你;)为了一点帮助:

The spec

Gradient Tool