> For the complete documentation index, see [llms.txt](https://ploegert.gitbook.io/til/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ploegert.gitbook.io/til/programmy/css/create-a-pulsing-background-with-css-animation.md).

# Create A Pulsing Background With CSS Animation

You can create a smoothly pulsing background effect with CSS animations. This can be achieved by defining a set of keyframes that start at one background color, transitions to another color, and then transitions back to the original color.

```css
@keyframes pulse {
  0%, 100% {
    background-color: #f56a3f;
  }
  50% {
    background-color: #9e42b0;
  }
}
```

At the beginning (`0%`) and end (`100%`) we declare the background color to be `#f56a3f`. Halfway through (`50%`) it should be `#9e42b0`. The browser will animate everything in between.

This can then be applied infinitely with a lengthy duration to give it a real smooth feel.

```css
body {
  animation: pulse 20s infinite;
}
```

Here is a [live example](https://codepen.io/jbranchaud/pen/vYYqQjO).

[source](https://css-tricks.com/almanac/properties/a/animation/)


---

# 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://ploegert.gitbook.io/til/programmy/css/create-a-pulsing-background-with-css-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.
