CSSFeb 28, 2026 · Updated Oct 13, 2026·4 min

CSS Clip-Path & Shapes: Complete Guide

✂️
Try the Clip-Path Maker
Create custom CSS clip-path shapes visually
→
DG
Derek Giordano
Designer & Developer
In this guide
01What Is clip-path?02Basic Shape Functions03Polygon Deep Dive04Section Dividers05Image Masking06Animating Clip Paths07Responsive Clip Paths08path() vs shape(), and a Measured Example09Best Practices

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.

/* Diagonal cut */ clip-path: polygon( 0 0, 100% 0, 100% 85%, 0 100% ); /* Hexagon */ clip-path: polygon( 50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25% );

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 tallAngle
320px wide10.6°
768px wide4.5°
1440px wide2.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.

Design clip-paths visually

Create polygon, circle, and ellipse clips with a visual editor.

⚡ Open Clip-Path Maker
DG
Derek Giordano
Written by the creator of Ultimate Design Tools. BA in Business Marketing.
⚡ Try the free SVG Path Editor →