我text-decoration:blink在我的css代码中设置了这个css属性.不幸的是它只适用于Firefox.必须有一种方法来显示克罗姆的闪烁效果.你们必须有答案..
小智 10
答案在这里:http://www.john-smith.me/emulating--lt-blink-gt--using-webkit-css3-animation.在这个例子中,类.blink会使某些东西闪烁......你必须写两次因为Chrome需要-webkit-当Firefox或Opera不需要时.
<style>
/**
* Emulating <blink> using WebKit CSS3 animation
* This code is part of John Smith's blog
*
* Copyright 2010 by John Smith, All Rights Reserved
*
* @link http://www.john-smith.me/emulating--lt-blink-gt--using-webkit-css3-animation
* @date 18th October 2010 at 11:01 p.m.
* @author John Smith
*/
@-webkit-keyframes blinker { from {opacity:1.0;} to {opacity:0.0;} }
@keyframes blinker { from {opacity:1.0;} to {opacity:0.0;} }
.blink {
text-decoration:blink;
-webkit-animation-name:blinker;
animation-name:blinker;
-webkit-animation-iteration-count:infinite;
animation-iteration-count:infinite;
-webkit-animation-timing-function:cubic-bezier(1.0,0,0,1.0);
animation-timing-function:cubic-bezier(1.0,0,0,1.0);
-webkit-animation-duration:1s;
animation-duration:1s;
}
</style>
Run Code Online (Sandbox Code Playgroud)
您可以保留(或不保留)旧浏览器的旧blink属性(如您所愿).
我更喜欢只使用-webkit-(一次)而且我保留文本装饰,因为Opera和Firefox都知道它.(对于其他动画,没有选择.只是为了眨眼他们已经知道该怎么做了).
但这只是因为我不喜欢写两次而且我很懒.这不是建议.
| 归档时间: |
|
| 查看次数: |
15863 次 |
| 最近记录: |