# Sliced Text Hover

> A word cut diagonally in two with clip-path, the halves sliding apart on hover or focus.

- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: glitch, slice, clip-path, split, link
- Live preview: https://copy-css.com/snippets/sliced-text-hover
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<a class="text-slice" href="#">
  <span>SLICE</span>
  <span aria-hidden="true">SLICE</span>
</a>
```

## CSS

```css
.text-slice {
  display: inline-grid;
  color: #18181b;
  font: 900 52px/1 system-ui, sans-serif;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.text-slice span {
  grid-area: 1 / 1;
  transition: transform 0.35s cubic-bezier(0.3, 0.7, 0.2, 1), color 0.35s ease;
}

.text-slice span:first-child {
  clip-path: polygon(0 0, 100% 0, 100% 40%, 0 62%);
}

.text-slice span:last-child {
  clip-path: polygon(0 62%, 100% 40%, 100% 100%, 0 100%);
}

.text-slice:hover span:first-child,
.text-slice:focus-visible span:first-child {
  transform: translate(-6px, -2px);
}

.text-slice:hover span:last-child,
.text-slice:focus-visible span:last-child {
  color: #e11d48;
  transform: translate(6px, 2px);
}

.text-slice:focus-visible {
  outline: 2px solid #18181b;
  outline-offset: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .text-slice span { transition: color 0.35s ease; }
}
```

## Notes

- This CSS Sliced Text Hover is 40 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses transitions, transforms, clip paths and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
