CSS Clip-Path & Shapes: Complete Guide
What Is clip-path?
The CSS clip-path property defines a clipping region. Anything inside is visible; everything outside is hidden. Unlike overflow: hidden, clip-path creates complex non-rectangular shapes.
Clip-path accepts polygon(), circle(), ellipse(), inset(), and path(). Common uses: decorative section dividers, custom image shapes, reveal animations, and creative hero sections.
Basic Shape Functions
inset() creates rectangular clips with optional rounded corners. circle() creates circular clips by radius and center. ellipse() creates oval clips with separate horizontal and vertical radii.
circle(50%) creates a perfect circle centered on the element. ellipse(50% 30%) creates a wide, short ellipse.
Polygon Deep Dive
polygon() is the most versatile. It accepts coordinate pairs defining vertices. The browser connects vertices with straight lines. Top-left is 0% 0%, bottom-right is 100% 100%.
Complex shapes — stars, chevrons, hexagons — require more vertices. The Clip-Path Maker plots vertices visually and generates the coordinates automatically.
Section Dividers
Diagonal dividers use polygon on the section element. Apply complementary angles to adjacent sections for seamless zigzag flow.
Wave dividers use SVG positioned absolutely at the section bottom. The SVG Wave Generator creates these with adjustable amplitude and frequency.
Image Masking
Clip-path on images creates non-rectangular crops without image editing. Circle clips for headshots, diamond clips for portfolio grids — all in CSS, all reversible.
Unlike border-radius: 50%, clip-path creates true shape masks on any aspect ratio, and it also clips hit-testing: clicks and hovers outside the visible shape pass through to whatever is behind (see our triangle guide for the measurement).
Animating Clip Paths
Clip paths animate only between values of the same function, and polygons only when they have the same number of vertices. In our Chromium test, a 3-vertex triangle transitioning to a 4-vertex square did not animate at all — halfway through the 1s transition the value had already jumped to the square — while a triangle written with a duplicated fourth vertex interpolated smoothly. circle(0%) to circle(71%) gives a full circular wipe (71% reaches the corners).
For smooth polygon transitions, pad simpler shapes with duplicate vertices to match the more complex shape's vertex count.
Responsive Clip Paths
Percentage-based values scale with the box, but angles do not stay the same: a percentage polygon stretches with the element's aspect ratio. Measured below, the same diagonal cut on a 400px-tall section is 10.6° at 320px wide and 2.4° at 1440px.
Test on narrow screens. A dramatic diagonal at 1440px might clip important content at 320px. Use media queries to adjust.
path() vs shape(), and a Measured Example
path() takes an SVG path string whose numbers are pixels, so it does not scale with the element. shape(), from CSS Shapes Level 2, describes the same kinds of curves and lines with CSS units, including percentages, so it stretches with the box. MDN's compatibility data lists shape() in Chrome and Edge 135, Safari 18.4 and Firefox 148 (checked October 13, 2026); keep a polygon() fallback before it for older browsers.
We tested both in Chromium 141 (script and results in our test folder): a triangle clip on a 200px box, then the box widened to 600px. The path() version stayed a 200px triangle at the left — a click 590px across hit nothing — while the shape() version stretched to the new width and the same click landed on the element.
Diagonal cut polygon(0 0, 100% 0, 100% 85%, 0 100%), 400px tall | Angle |
|---|---|
| 320px wide | 10.6° |
| 768px wide | 4.5° |
| 1440px wide | 2.4° |
If a design needs the same visible slope everywhere, express the cut in fixed units (calc(100% - 60px)) instead of a percentage of the height, and check it at the narrowest width.
Best Practices
Content outside the clip region is hidden but still occupies layout space. Use clip-path for visual shaping, not hiding content.
Provide visual fallbacks for maximum compatibility. A rectangular version that still looks good without clip-path.
Create polygon, circle, and ellipse clips with a visual editor.
⚡ Open Clip-Path Maker- [1]W3C CSS Shapes Module Level 1: basic shapes (circle radius percentages, polygon) ↗
- [2]W3C CSS Shapes Module Level 2: the shape() function ↗
- [3]MDN Browser Compatibility Data: shape() (Chrome 135, Safari 18.4, Firefox 148; checked Oct 13, 2026) ↗
- [4]MDN Web Docs: clip-path ↗
- [5]W3C CSS Masking Module Level 1: clip-path and hit-testing ↗