Toggle navigation
☰
HTML
CSS
Scripting
Database
<!doctype html> <title>Example</title> <style> body { display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; font-family: sans-serif; background-color: #222; } .gradient-text { font-size: 4rem; font-weight: 900; text-transform: uppercase; /* 1. Set the gradient background */ background: linear-gradient( to right, #ff00cc, #3333ff, #00ffcc, #ff00cc ); /* Make the background oversized so we can pan it */ background-size: 300% auto; /* 2. Clip the background to the text (Webkit specific but widely supported) */ color: transparent; -webkit-background-clip: text; background-clip: text; /* 3. Animate the background position */ animation: shine 5s linear infinite; } @keyframes shine { to { background-position: 300% center; } } @media (prefers-reduced-motion: reduce) { .gradient-text { animation: none; /* Stops the color shift */ background-position: 0% center; /* Locks it to the first color stop */ } } </style> <div class="gradient-text">Gradient</div>