大家都知道,不管是什么项目,在前端里都必须要注意的一点就是兼容性。今天就给大家好好说一下关于兼容性验证的问题。
我们知道,不论做什么前端项目,一定要注意的事项就是兼容性,那么今天就给大家带来一份详细的攻略,我们来看看需要兼容验证的浏览器有哪些。
我们知道,通过强大的CSS3可以创建各种动画和特效,这是可以在很多网页中取代图片,Flash动画以及JavaScript,今天就来给大家介绍一下CSS3的@keyframes 规则
CSS3 @keyframes 规则
如需在 CSS3 中创建动画,您需要学习 @keyframes 规则。
立即学习“前端免费学习笔记(深入)”;
@keyframes 规则用于创建动画。在 @keyframes 中规定某项 CSS 样式,就能创建由当前样式逐渐改为新样式的动画效果。
那么如何使用Css的animation动画改版背景和位置,代码如下:
@keyframes myfirst{0% {background: red; left:0px; top:0px;}25% {background: yellow; left:200px; top:0px;}50% {background: blue; left:200px; top:200px;}75% {background: green; left:0px; top:200px;}100% {background: red; left:0px; top:0px;}} @-moz-keyframes myfirst /* Firefox */{0% {background: red; left:0px; top:0px;}25% {background: yellow; left:200px; top:0px;}50% {background: blue; left:200px; top:200px;}75% {background: green; left:0px; top:200px;}100% {background: red; left:0px; top:0px;}} @-webkit-keyframes myfirst /* Safari 和 Chrome */{0% {background: red; left:0px; top:0px;}25% {background: yellow; left:200px; top:0px;}50% {background: blue; left:200px; top:200px;}75% {background: green; left:0px; top:200px;}100% {background: red; left:0px; top:0px;}} @-o-keyframes myfirst /* Opera */{0% {background: red; left:0px; top:0px;}25% {background: yellow; left:200px; top:0px;}50% {background: blue; left:200px; top:200px;}75% {background: green; left:0px; top:200px;}100% {background: red; left:0px; top:0px;}}
登录后复制
相信看了这些案例你已经掌握了方法,更多精彩请关注【创想鸟】其它相关文章!
相关阅读:
CSS3关于translate属性的详细介绍
CSS3关于translate属性的详细介绍
CSS3关于translate属性的详细介绍
以上就是css的animation动画的使用教程的详细内容,更多请关注【创想鸟】其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至253000106@qq.com举报,一经查实,本站将立刻删除。
发布者:PHP中文网,转转请注明出处:https://www.chuangxiangniao.com/p/3121159.html