本篇文章给大家带来的内容是关于css中动画属性的实现方法(附代码),有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助。
一、css动画(animation)属性可以逐渐地从一个值变化到另一个值,比如尺寸大小、数量、百分比、位置和颜色。
二、实现方法:
1.定义动画(slideOut为自定义的动画名称)
@-webkit-keyframes slideOut{ 0%{top:-30px; opacity: 0;} 100%{top:0px; opacity: 1;} } @-moz-keyframes slideOut{ 0%{top:-30px; opacity: 0;} 100%{top:0px; opacity: 1;} } @-o-keyframes slideOut{ 0%{top:-30px; opacity: 0;} 100%{top:0px; opacity: 1;} } @-ms-keyframes slideOut{ 0%{top:-30px; opacity: 0;} 100%{top:0px; opacity: 1;} } @keyframes slideOut{ 0%{top:-30px; opacity: 0;} 100%{top:0px; opacity: 1;} }
2、调用动画
-webkit-animation: slideOut 0.5s ease-in-out 0.3s backwards; -moz-animation: slideOut 0.5s ease-in-out 0.3s backwards; -o-animation: slideOut 0.5s ease-in-out 0.3s backwards; -ms-animation: slideOut 0.5s ease-in-out 0.3s backwards; animation: slideOut 0.5s ease-in-out 0.3s backwards;
三、动画用到的属性有background/border/border/box-shadow/clip/color/column/filter/flex/font/letter-spacing/line-height/margin/opacity/outline/perspective/text/vertical-align/visibility/word-spacing/z-index等等,基本上所以元素了。
相关推荐:
CSS动画之Tranistion_html/css_WEB-ITnose
以上是css中动画属性的实现方法(附代码)的详细内容。更多信息请关注PHP中文网其他相关文章!

这是我们在形式可访问性上进行的小型系列中的第三篇文章。如果您错过了第二篇文章,请查看“以:focus-visible的管理用户焦点”。在

CSS盒子阴影和轮廓属性获得了主题。让我们查看一些在真实主题中起作用的示例,以及我们必须将这些样式应用于WordPress块和元素的选项。

Svelte Transition API提供了一种使组件输入或离开文档(包括自定义Svelte Transitions)时动画组件的方法。


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

Atom编辑器mac版下载
最流行的的开源编辑器

Dreamweaver Mac版
视觉化网页开发工具

VSCode Windows 64位 下载
微软推出的免费、功能强大的一款IDE编辑器

适用于 Eclipse 的 SAP NetWeaver 服务器适配器
将Eclipse与SAP NetWeaver应用服务器集成。

EditPlus 中文破解版
体积小,语法高亮,不支持代码提示功能