目录

CSS 可动画化


定义和用法

一些 CSS 属性是可动画的,这意味着它们可以用于动画和过渡。

可设置动画的属性可以逐渐从一个值变为另一个值,例如大小、数字、百分比和颜色。


浏览器支持

表中的数字指定了第一个完全支持 CSS 动画的浏览器版本。

后跟 -webkit-、-moz- 或 -o- 的数字指定使用前缀的第一个版本。

43.0
4.0 -webkit-
10.0 16.0
5.0 -moz-
9.0
4.0 -webkit-
30.0
15.0 -webkit-
12.0 -o-

示例

将背景颜色从红色动画化为蓝色:

@keyframes mymove {
  from {background-color: red;}
  to {background-color: blue;}
}
亲自试一试 »


可动画化的属性

这些属性是可动画的在CSS中:

Property
aspect-ratio尝试一下
background尝试一下
background-color尝试一下
background-position尝试一下
background-position-x尝试一下
background-position-y尝试一下
background-size尝试一下
block-size尝试一下
border尝试一下
border-bottom尝试一下
border-bottom-color尝试一下
border-end-end-radius尝试一下
border-end-start-radius尝试一下
border-block尝试一下
border-block-color尝试一下
border-block-end-color尝试一下
border-block-end-width尝试一下
border-block-start-color尝试一下
border-block-start-width尝试一下
border-block-width尝试一下
border-bottom-left-radius尝试一下
border-bottom-right-radius尝试一下
border-inline尝试一下
border-inline-color尝试一下
border-inline-end-color尝试一下
border-inline-end-width尝试一下
border-inline-start-color尝试一下
border-inline-start-width尝试一下
border-inline-width尝试一下
border-start-end-radius尝试一下
border-start-start-radius尝试一下
border-bottom-width尝试一下
border-color尝试一下
border-left尝试一下
border-left-color尝试一下
border-left-width尝试一下
border-right尝试一下
border-right-color尝试一下
border-right-width尝试一下
border-spacing尝试一下
border-top尝试一下
border-top-color尝试一下
border-top-left-radius尝试一下
border-top-right-radius尝试一下
border-top-width尝试一下
bottom尝试一下
box-shadow尝试一下
clip尝试一下
color尝试一下
column-count尝试一下
column-gap尝试一下
column-rule尝试一下
column-rule-color尝试一下
column-rule-width尝试一下
column-width尝试一下
columns尝试一下
filter尝试一下
flex尝试一下
flex-basis尝试一下
flex-grow尝试一下
flex-shrink尝试一下
font尝试一下
font-size尝试一下
font-size-adjust
font-stretch
font-weight尝试一下
grid尝试一下
grid-area尝试一下
grid-auto-columns尝试一下
grid-auto-flow尝试一下
grid-auto-rows尝试一下
grid-column尝试一下
grid-column-end尝试一下
grid-column-gap尝试一下
grid-column-start尝试一下
grid-gap尝试一下
grid-row尝试一下
grid-row-end尝试一下
grid-row-gap尝试一下
grid-row-start尝试一下
grid-template尝试一下
grid-template-areas尝试一下
grid-template-columns尝试一下
grid-template-rows尝试一下
height尝试一下
inline-size尝试一下
inset尝试一下
inset-block尝试一下
inset-block-end尝试一下
inset-block-start尝试一下
inset-inline尝试一下
inset-inline-end尝试一下
inset-inline-start尝试一下
left尝试一下
letter-spacing尝试一下
line-height尝试一下
margin尝试一下
margin-block尝试一下
margin-block-end尝试一下
margin-block-start尝试一下
margin-bottom尝试一下
margin-inline尝试一下
margin-inline-end尝试一下
margin-inline-start尝试一下
margin-left尝试一下
margin-right尝试一下
margin-top尝试一下
max-height尝试一下
max-width尝试一下
max-block-size尝试一下
max-inline-size尝试一下
min-block-size尝试一下
min-inline-size尝试一下
min-height尝试一下
min-width尝试一下
object-position尝试一下
offset-anchor尝试一下
offset-distance尝试一下
offset-path尝试一下
offset-rotate尝试一下
opacity尝试一下
order尝试一下
outline尝试一下
outline-color尝试一下
outline-offset尝试一下
outline-width尝试一下
padding尝试一下
padding-block尝试一下
padding-block-end尝试一下
padding-block-start尝试一下
padding-bottom尝试一下
padding-inline尝试一下
padding-inline-end尝试一下
padding-inline-start尝试一下
padding-left尝试一下
padding-right尝试一下
padding-top尝试一下
perspective尝试一下
perspective-origin尝试一下
right尝试一下
rotate尝试一下
scale尝试一下
text-decoration-color尝试一下
text-indent尝试一下
text-shadow尝试一下
top尝试一下
transform尝试一下
transform-origin尝试一下
translate尝试一下
vertical-align尝试一下
visibility
width尝试一下
word-spacing尝试一下
z-index尝试一下