CSS clip-path Property

Beginner
6 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The clip-path property sets a clipping region for an element. Content inside the region stays visible; everything outside is hidden.

Start with basic shapes: circle(), inset(), ellipse(), and polygon(). Unlike the deprecated clip property, clip-path works without absolute positioning and is the modern choice.

Baseline · Widely available.

Not deprecated and not experimental. Prefer clip-path over clip for new work. Internet Explorer does not support it.

CSS Syntax

syntax.css
clip-path: none | circle() | inset() | ellipse() | polygon() | url() | initial | inherit;

The initial value is none. The property is not inherited. A value other than none also creates a new stacking context.

Property Values

ValueDescriptionTry it
noneNo clipping (default)Try it
circle()Circular region; optional at positionTry it
inset()Rectangle inset from the edges; optional roundTry it
polygon()Custom shape from a list of pointsTry it
ellipse()Oval region with two radiiTry it
initialResets to noneTry it
inheritUses the parent’s clip-path valueTry it

How to Use clip-path

Give the element a size and background (or image), then apply a shape.

  1. Style a box with width, height, and a visible background or image.
  2. Add clip-path with a basic shape such as circle(50%).
  3. Tune the shape: radius, at position, inset distances, or polygon points.
  4. Remember: clipped parts are not painted and usually do not receive pointer events outside the path.
PieceRequired?Role
Visible contentYesBackground, image, or text to clip
Shape functionYes (to clip)circle(), inset(), polygon(), …
position: absoluteNoUnlike old clip, not required
Square boxHelpful for circlesA non-square box can flatten a circle(50%)

Live Preview

The blue square starts unclipped. Change only clip-path.

Outside the shape is hidden. The element’s layout size does not shrink.

Box

clip-path: circle(50%)

CSS Examples

Each snippet focuses on clip-path. Size and background are only there so the shape is visible. Use Try It Yourself for a live editor.

Example 1 — Circle

Clip a square into a circle with a 50% radius.

CSS
<style>
  div {
    width: 160px;
    height: 160px;
    background: #2563eb;
    clip-path: circle(50%);
  }
</style>

<div></div>
Try It Yourself

How It Works

  1. Make a square. Equal width and height keep the circle round.
  2. Add a fill. A solid background shows the clipped shape clearly.
  3. Apply the circle. circle(50%) uses half the shorter side as the radius by default.
  4. Corners disappear. Only the circular region is painted.

Example 2 — Inset Rectangle

Pull the visible area in from every edge, with rounded corners.

CSS
<style>
  div {
    width: 160px;
    height: 160px;
    background: #2563eb;
    clip-path: inset(12% round 12px);
  }
</style>

<div></div>
Try It Yourself

How It Works

  1. Keep the same box. Size and color stay simple.
  2. Inset all sides. One 12% value insets top, right, bottom, and left equally.
  3. Round the clip. round 12px curves the clipped corners.
  4. Outer strip is gone. The margin of the original square is no longer painted.

Example 3 — Polygon Triangle

Connect three points to form a triangle.

CSS
<style>
  div {
    width: 160px;
    height: 160px;
    background: #2563eb;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  }
</style>

<div></div>
Try It Yourself

How It Works

  1. List points in order. Each pair is x y as a percentage of the box.
  2. Top tip. 50% 0% is the middle of the top edge.
  3. Base corners. 100% 100% and 0% 100% are the bottom-right and bottom-left.
  4. Browser closes the shape. The three points form a triangle clip.

Edge Cases & Pitfalls

If the shape looks wrong, check these first.

size

Layout size does not shrink

Clipping hides paint; the element still occupies its full width and height in the layout.

circle

Non-square boxes flatten circles

On a wide rectangle, circle(50%) can hit the short sides and look cut off. Use a square for a full circle.

legacy

Do not mix up with clip

The old clip property is deprecated and rectangle-only. Prefer clip-path for new code.

stack

Creates a stacking context

Any value other than none creates a new stacking context, similar to opacity less than 1.

overflow

Simple crops may not need clip-path

To hide overflowing children in a box, overflow: hidden is often enough. Use clip-path when you need a custom shape.

Browser Support

clip-path is a browser CSS property for clipping shapes. Node.js, Deno, and Bun do not apply it.

✓ Baseline · Widely available

clip-path

Basic shapes (circle, inset, ellipse, polygon): Chrome 55+, Edge 79+, Firefox 54+, Safari 13.1+. Internet Explorer has no support.

96% Modern browser support
Google Chrome 55+
Full support (basic shapes)
Mozilla Firefox 54+
Full support (basic shapes)
Apple Safari 13.1+
Full support (basic shapes)
Microsoft Edge 79+
Full support (basic shapes)
Opera 42+
Full support (basic shapes)
Samsung Internet 6.2+
Full support (basic shapes)
Internet Explorer No support
Not supported
clip-path (basic shapes) Widely supported

Bottom line: Safe for modern sites. Fall back to an unclipped box or overflow: hidden when IE matters. Newer functions like path() need newer browsers. It is not a runtime API.

Key Takeaways

  • Role: show only the part of an element inside a shape.
  • Start here: circle(), inset(), and polygon().
  • Modern: replaces deprecated clip; no absolute position required.
  • Initial value: none. Not inherited. Non-none creates a stacking context.

One line: sized box + clip-path: circle(50%); = circular visible region.

Frequently Asked Questions

It hides everything outside a shape you choose. Parts inside the path stay visible. Common shapes are circle(), inset(), and polygon().
The initial value is none, which means no clipping and the whole element stays visible.
clip is deprecated, rectangle-only, and needs absolute or fixed positioning. clip-path is the modern property: it works on most elements and supports circles, polygons, and more.
No. Unlike the old clip property, clip-path works on normal static elements. Absolute positioning is not required.
Yes, between compatible shapes in supporting browsers. Matching point counts in polygon() values makes morphing smoother.
It is Baseline Widely available. Basic shapes work in Chrome 55+, Edge 79+, Firefox 54+, and Safari 13.1+ (with earlier partial support). Internet Explorer does not support it. It is a browser CSS property, not a Node.js feature.

Next: color

Set the foreground text and currentColor for borders and fills.

color tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

14 people found this page helpful