Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> CSS

Animation @keyframes trong CSS3

Giới thiệu

@keyframes kiểm soát các bước trung gian của animation trong CSS3.

Ví dụ

Ví dụ minh họa chiều cao, chiều rộng, màu sắc, tên và thời gian animation với cú pháp keyframes:

@keyframes animation {
    from {background-color: pink;}
    to {background-color: green;}
}
div {
    width: 100px;
    height: 100px;
    background-color: red;
    animation-name: animation;
    animation-duration: 5s;
}