css3动画
2016-05-09 15:50
411 查看
css3改变背景色和位置的动画时层上一定要加 position:relative
css3 ie10以上支持 火狐支持 欧朋支持 苹果和谷歌支持但必须加-webkit-
@keyframes myfirst{
0%{background:red;left:0px;top:0px;}
25%{background:yellow;left:0px;top:20px;}
50%{background:blue;left:20px;top:20px;}
75%{background:green;left:20px;top:0px;}
100%{background:red;left:0px;top:0px;}
}
@-webkit-keyframes myfirst{
0%{background:red;left:0px;top:0px;}
25%{background:yellow;left:0px;top:20px;}
50%{background:blue;left:20px;top:20px;}
75%{background:green;left:20px;top:0px;}
100%{background:red;left:0px;top:0px;}
}
.dd{
width:200px;
height:200px;
background:red;
position:relative;
-webkit-animation:myfirst 2s linear 2s infinite 循环播放 alternate 逆向播放;
-webkit-animation-play-state:running/paused;// 这个必须单独写 指定动画是否正在运行或已暂停
animation: myfirst 2s linear 2s infinite 循环播放 alternate 逆向播放;
animation-play-state:running/paused;//这个必须单独写 指定动画是否正在运行或已暂停
}
css3 ie10以上支持 火狐支持 欧朋支持 苹果和谷歌支持但必须加-webkit-
@keyframes myfirst{
0%{background:red;left:0px;top:0px;}
25%{background:yellow;left:0px;top:20px;}
50%{background:blue;left:20px;top:20px;}
75%{background:green;left:20px;top:0px;}
100%{background:red;left:0px;top:0px;}
}
@-webkit-keyframes myfirst{
0%{background:red;left:0px;top:0px;}
25%{background:yellow;left:0px;top:20px;}
50%{background:blue;left:20px;top:20px;}
75%{background:green;left:20px;top:0px;}
100%{background:red;left:0px;top:0px;}
}
.dd{
width:200px;
height:200px;
background:red;
position:relative;
-webkit-animation:myfirst 2s linear 2s infinite 循环播放 alternate 逆向播放;
-webkit-animation-play-state:running/paused;// 这个必须单独写 指定动画是否正在运行或已暂停
animation: myfirst 2s linear 2s infinite 循环播放 alternate 逆向播放;
animation-play-state:running/paused;//这个必须单独写 指定动画是否正在运行或已暂停
}
相关文章推荐
- CSS学习(八)——定义选择器
- <td></td>标签的border 样式在浏览器中显示不出来的解决方法
- web前端之css_day1
- CSS浮动 (比较详细、生动、经典)
- CSS3选择器:nth-of-type
- 几个CSS3动画
- 超实用的样式写法
- CSS控制a标签链接的四种状态
- DataGridView自定义行样式和行标题
- [翻译]理解CSS模块方法
- 【27前端】在线css三角
- base.css(重设浏览器默认样式)
- 【27前端】CSS Reset
- css table圆角设置
- 用样式表美化QTabwidget外观
- CSS中的圣杯布局,以及圣杯布局与双飞翼布局的区别
- 经常使用的两个清爽的table样式
- css中块元素和行内元素区别
- css中块元素和行内元素区别
- css控制字符长度超出变成点点点显示(单行,多行)