css 动画的两大组成部分:transition和animation。
img{ height:15px; width:15px; } img:hover{ height: 450px; width: 450px; }
img{ transition:1s; }
img{ transition:1s height }
img{ transition:1s height,1s width }
img{ transition:1s height,1s 1s width; }
img{ transition:1s ease; }
img{ transition:1s height cubic-bezier(.83,.97,.05,1.44) }
img{ transition:1s 1s height ease; }
img{ transition-property:height;transition-duration:1s;transition-delay:1s;transition-timing-function:ease; }
div:hover{ animation:1s rainbow; }
div:hover {
animation: 1s rainbow infinite;
}
div:hover{
animation:1s rainbow 3;
}
div:hover{ animation:1s rainbow forwards; }
@keyframes rainbow {
0% { background-color: yellow; }
100% { background: blue; }
}
div:hover {
animation: 1s rainbow 3 normal;
}
div:hover {
animation: 1s 1s rainbow linear 3 forwards normal;
}
div:hover {
animation-name: rainbow;
animation-duration: 1s;
animation-timing-function: linear;
animation-delay: 1s;
animation-fill-mode:forwards;
animation-direction: normal;
animation-iteration-count: 3;
}
@keyframes rainbow {
0% { background: #c00 }
50% { background: orange }
100% { background: yellowgreen }
}
@keyframes rainbow {
from { background: #c00 }
50% { background: orange }
to { background: yellowgreen }
}
@keyframes rainbow {
50% { background: orange }
to { background: yellowgreen }
}
@keyframes rainbow {
to { background: yellowgreen }
}
@keyframes pound {
from,to { transform: none; }
50% { transform: scale(1.2); }
}
div:hover {
animation: 1s rainbow infinite steps(10);
}
div:hover {
-webkit-animation: 1s rainbow;
animation: 1s rainbow;
}
@-webkit-keyframes rainbow {
0% { background: #c00; }
50% { background: orange; }
100% { background: yellowgreen; }
}
@keyframes rainbow {
0% { background: #c00; }
50% { background: orange; }
100% { background: yellowgreen; }
}
原文:https://www.cnblogs.com/wenshaochang123/p/14913852.html