> For the complete documentation index, see [llms.txt](https://docs.webmix.cc/css-animation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.webmix.cc/css-animation/dong-hua-xiao-guo-animation/5.3-tong-ge-yuan-su-tao-yong-duo-ge-animation.md).

# 5.3 同個元素套用多個 animation

## 元素套用兩個動畫效果(@keyframes)

* 0% \~ 50%：從 0 度旋轉 360度。
* 50% \~ 100%：從 360 倒轉回至 0 度。

```css
@keyframes rotation {
  50% {
    transform: rotate(360deg);
  }
}
```

* 0% \~ 50%：margin-left 從 0 跑到 300px。
* 50% \~ 100%：margin-left 從 300px 跑回至 0。

```css
@keyframes move {
  50% {
    margin-left: 300px;
  }
}
```

### 某個元素套用兩個或多個動畫效果

* 各個動畫效果以半形逗號做分隔。
* rotation 動畫效果總共執行 3 秒。
* move 動畫效果總共執行 6 秒。

```css
div.img_block{
  animation-name: rotation, move;
  animation-duration: 3s, 6s;
}
```

### 範例

{% embed url="<https://codepen.io/carlos411/pen/mdyEEjr>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.webmix.cc/css-animation/dong-hua-xiao-guo-animation/5.3-tong-ge-yuan-su-tao-yong-duo-ge-animation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
