About this snippet

Add life to your landing pages with this moving gradient background. It shifts colors smoothly over time using CSS animations, which creates a calming and premium effect without using any images.

Size
907 bytes
Uses
HTML, CSS
Loads
Nothing external
Views
440
<div class="gradient-bg">
  <div class="content">
    <h1>Flowing Colors</h1>
    <p>Pure CSS background animation.</p>
  </div>
</div>
.gradient-bg {
  font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  width: 100%;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
  background-size: 400% 400%;
  animation: gradient 15s ease infinite;
  border-radius: 12px;
  color: white;
  text-align: center;
}

.content h1 {
  font-size: 3rem;
  margin: 0 0 10px 0;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.content p {
  font-size: 1.2rem;
  opacity: 0.9;
}

@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
Esc
↑↓ moveEnter select

Start from a template

Open an .html file, or HTML, CSS, JS, Markdown, Less or TypeScript files. You can also drop them here. Styles and scripts go into their panes.

Share

Source

Keyboard shortcuts

Save