【发布时间】:2014-04-23 04:47:16
【问题描述】:
在这里看到了一些类似的问题,但似乎无法特别解决这个问题。
我有一个顶部为黑色,底部为蓝色的渐变。我希望蓝色在一个连续的循环中褪色为几种不同的颜色,但黑色保持原位。像这样:http://i.stack.imgur.com/6k9EN.gif
看到了一些演示,例如this one,其中渐变连续动画,但它只是一个大渐变与关键帧垂直移动,这对我不起作用。想知道是否有人可以推荐一个解决方案。
这是到目前为止的非动画代码:http://jsfiddle.net/ssccdd/9qA3L/
body{
background: -moz-linear-gradient(top, #000000 80%, #3300FF 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#1e5799), color-stop(100%,#7db9e8));
background: -webkit-linear-gradient(top, #1e5799 80%,#3300FF 100%);
background: -o-linear-gradient(top, #000000 80%,#3300FF 100%);
background: -ms-linear-gradient(top, #000000 80%,#3300FF 100%);
background: linear-gradient(to bottom, #000000 80%,#3300FF 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#000000', endColorstr='#3300FF',GradientType=0 );
background-attachment: fixed;
}
【问题讨论】:
-
看到这个类似的问题:stackoverflow.com/questions/10963059/…
-
具有动画
top的绝对伪元素?
标签: css css-transitions gradient animated