好的,我没有得到这个.我以前做过 CSS3动画,但出于某种原因,简单地设置不透明度的动画对我今天起作用.我错过了一些傻事吗? CSS: @-webkit-keyframes fadein { from: { opacity: 0; } to: { opacity: 1
CSS:
@-webkit-keyframes fadein { from: { opacity: 0; } to: { opacity: 1; } } @-moz-keyframes fadein { from: { opacity: 0; } to: { opacity: 1; } } @keyframes fadein { from: { opacity: 0; } to: { opacity: 1; } } #foo { background-color: green; color: white; -webkit-animation: fadein 2s ease-in alternate infinite; -moz-animation: fadein 2s ease-in alternate infinite; animation: fadein 2s ease-in alternate infinite; }
HTML:
<div id="foo">This is Foo!</div>
我也发布它作为小提琴:
http://jsfiddle.net/NRutman/Lcyvy/
任何帮助,将不胜感激.
谢谢,
-Nate
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
http://jsfiddle.net/Lcyvy/6/