# Rotating Words

> A headline where one word cycles through options. Pure CSS, no JavaScript.

- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: rotate, words, headline, animation, hero
- Live preview: https://copy-css.com/snippets/rotating-words
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<p class="rotator">Build <span><b>faster</b><b>better</b><b>bolder</b></span></p>
```

## CSS

```css
.rotator {
  display: flex;
  gap: 0.3em;
  margin: 0;
  color: #111;
  font: 700 32px/1.2 system-ui, sans-serif;
}

.rotator span {
  display: inline-flex;
  flex-direction: column;
  height: 1.2em;
  overflow: hidden;
}

.rotator b {
  color: #7c3aed;
  animation: rotate-words 6s infinite;
}

@keyframes rotate-words {
  0%, 28% { transform: translateY(0); }
  33%, 61% { transform: translateY(-100%); }
  66%, 94% { transform: translateY(-200%); }
  100% { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .rotator b {
    animation: none;
  }
}
```

## Notes

- This CSS Rotating Words is 32 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, Flexbox and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
