CSS Shape Generator: clip-path Polygons and Six Silhouettes

Open Tool CSS Shape Generator

What clip-path actually cuts

clip-path leaves the box model untouched and clips only the painted result. polygon() takes percentage coordinates joined clockwise, and anything outside the path disappears. The clipped region still occupies layout space, and clicks may still land on the transparent part, which makes it a visual device rather than a true irregular container. The tool offers triangle, diamond, hexagon, star, speech bubble and bevel, emitting polygon code directly.

Steps

  1. Choose a silhouette among the six.
  2. Drag handles or type values to move vertices; stars expose inner and outer radii plus point count.
  3. Fill colour affects the preview only, not the pasted result.
  4. Copy code for the clip-path declaration, or load the example.
  5. Paste onto the target element with background, border or pseudo-elements.

Reading coordinates

Percentages are relative to the element's own width and height, with 0% 0% at the top left and 100% 100% at the bottom right. Triangles take three vertices; hexagons six, with points left and right and flats top and bottom; star vertices alternate outer and inner; speech bubbles add one tail; bevels slice a corner. Order must run consistently clockwise or counter-clockwise — a scrambled order self-intersects and tears the shape.

Conflicts with borders and shadows

Because clipping applies to all painting, borders and box-shadows get cut too. Outlines need either two layers — an outer shape as the border with an inset inner fill — or filter drop-shadow, which follows the clipped silhouette. Rounding and clip-path conflict, so pick one. Transitions can interpolate clip-path, but vertex counts must match, so triangle to hexagon jumps.

Compatibility and alternatives

Modern browsers support clip-path; older ones need prefixes or fall back to no clipping. Shapes that must alter layout or hit-testing need SVG or canvas. Print pipelines sometimes drop clip-path, where SVG travels better. Cards, avatar masks, image crops and progress shapes work well; buttons and form controls need care because transparent regions still capture events.

⏫︎