# clip

> The `clip` CSS property is a deprecated property that clipped absolutely positioned elements to a rectangle; use `clip-path` instead.

> **Deprecated.** Deprecated in the CSS standard. Use `clip-path`, which works with any element and any shape. Use instead: [clip-path](https://wonderium.dev/css/clip-path.md).

## Is CSS clip deprecated and what should I use instead?

The deprecated property that clipped an absolutely positioned element to a rectangle set with `rect()`. Browsers still support it, but the standard replaced it with `clip-path`, which works on any element and with any shape.

- Topic: Visibility
- Type: property
- Browser support: Chrome 1+, Chrome Android 18+, Edge 12+, Firefox 1+, Firefox Android 4+, Safari 1+, Safari iOS 1+

## Example

Wrong:

```css
.sr-only {
  position: absolute;
  clip: rect(0 0 0 0);
}
```

Right:

```css
.sr-only {
  position: absolute;
  clip-path: inset(50%);
}
```

`clip-path: inset(50%)` hides the box like the deprecated `clip` and works without the positioning rule.

## Common mistakes

- `clip` does nothing because the element isn't absolutely positioned.

## Key points

- New code uses `clip-path` instead of `clip`.
- Visually hidden classes use `clip-path: inset(50%)` instead of `clip: rect(0 0 0 0)`.

## Interview questions

### Does clip still work in browsers?

Yes, browsers still support it for compatibility, but it is deprecated and only applies to absolutely positioned elements.

### How do I convert clip: rect() to clip-path?

Use `clip-path: inset()` with distances from each edge; `rect()` in `clip` uses offsets from the top and left edges instead.

## Related cards

- [clip-path](https://wonderium.dev/css/clip-path.md)
- [inset()](https://wonderium.dev/css/inset.md)
- [position](https://wonderium.dev/css/position.md)
- [sr-only](https://wonderium.dev/a11y/sr-only.md)

---

- Level: [CSS](https://wonderium.dev/css.md)
- HTML version: https://wonderium.dev/css/clip
- Last updated: 2026-11-25
