博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
css动画总结
阅读量:6997 次
发布时间:2019-06-27

本文共 1157 字,大约阅读时间需要 3 分钟。

<!
DOCTYPE
html
>
<
html
lang=
"en"
>
<
head
>
<
meta
charset=
"UTF-8"
>
<
meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<
meta
http-equiv=
"X-UA-Compatible"
content=
"ie=edge"
>
<
title
>Document
</
title
>
<
style
>
* {
margin:
0;
padding:
0;
}
#box {
height:
100px;
width:
100px;
background:
green;
transition: transform
1s
ease-in
1s;
}
#box:hover {
transform:
rotate(
180deg)
scale(
.5,
.5);
}
/*
transition: property duration timing-function delay;
属性名字 完成动画的时间 动画的曲线 定义的效果何时开始的
transition:需要事件触发,只能定义一个属性的变化,不能涉及多个属性
*/
.box {
height:
100px;
width:
100px;
border:
15px
solid
black;
animation: changebox
1s
ease-in-out
1s
infinite
alternate
running
forwards;
}
.box:hover {
animation-play-state:
paused;
}
@keyframes
changebox {
10% {
background:
red;
}
50% {
width:
80px;
}
70% {
border:
15px
solid
yellow;
}
100% {
width:
180px;
height:
180px;
}
}
/* animation: 名称 动画时间 动画的曲线 动画何时开始 动画的次数 动画的方向*/
<
/
style
>
<!--
animation:动画的叠加
transition:单一动画
transform:缩放
translate:移动
-->
</
head
>
<
body
>
<
div
class=
"box"
></
div
>
</
body
>
</
html
>
<
script
>
<
/
script
>

转载于:https://www.cnblogs.com/yayaxuping/p/10979395.html

你可能感兴趣的文章
我的设计模式--------------责任链模式
查看>>
Java——循环应用
查看>>
云计算网络基础部分案列和必备知识点
查看>>
python之Linux基础(四)
查看>>
文本处理工具之sed的用法
查看>>
HTML.CSS,JS
查看>>
三个例子 —JAVA发送http get/post请求,调用http接口、方法
查看>>
Java - 集合框架完全解析
查看>>
从linux源码看epoll
查看>>
MyEclipse开发教程:REST Web Service(一)
查看>>
java类的加载过程
查看>>
配置简单的DHCP
查看>>
PDA是干什么用的
查看>>
等保2.0时代,数据安全如何合规
查看>>
Oracle RMAN 体系结构概述(一)
查看>>
mysql重新编译innodb引擎
查看>>
Struts2 注解
查看>>
加强网站安全、重构公司的门户网站项目(C# VS2003)
查看>>
开发一个完整android app 需要掌握哪些知识?
查看>>
通过域名解析访问http服务器
查看>>