🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Expert Masterclasses.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
REFERENCEcss

css Documentation

LOADING ENGINE...

CSS clip-path

Shape your elements. Learn to use clip-path to create circles, polygons, and complex masks.

style.css
/* Clip-path Polygon */
.shape {
clip-path: polygon(
50% 0%,
0% 100%,
100% 100%
);
}
style.css
1 / 9
✂️

Tutor:Welcome! CSS clip-path allows you to create complex shapes by clipping an element. Parts outside the clip region are hidden.


Shaping the Web

Unlock nodes by mastering clipping paths and coordinates.

Concept 1: Basic Shapes

Start with simple functions like circle() and inset(). These define the visible area of an element. Everything else is clipped.

System Check

Which function creates a rectangular clipping region?


Shape Library

Share Your Polygons

Created a cool star or hexagon? Share your coordinate pairs.

Enjoying this guide?

Codesyllabus is 100% free and open-source. Support our mission, pay for server infrastructure, and fuel new tutorials by buying us a coffee!

CSS Clip-Path

Author

Pascual Vila

Frontend Instructor.

The clip-path property creates a clipping region that sets what part of an element should be shown. Parts that are inside the region are shown, while those outside are hidden.

Basic Shapes

CSS provides several shape functions:

  • circle(): Creates a circular clipping region.
  • ellipse(): Similar to circle but allows independent width/height radii.
  • inset(): Defines an inset rectangle (cropping from edges).
  • polygon(): Defines a shape using multiple x,y coordinate pairs.

Coordinate System

Coordinates are usually relative to the element's box. 0 0 is the top-left corner, and 100% 100% is the bottom-right corner. You can use pixels, percentages, or other units.

Animation

One of the most powerful features of clip-path is that it is animatable. As long as the number of points in a polygon remains the same, you can transition between different shapes smoothly.

Clip-Path Glossary

clip-path
A CSS property that creates a clipping region. Everything outside this region is hidden.
polygon()
A function that accepts a set of comma-separated coordinate pairs (x y) to create a custom shape.
Reference Box
The box (content-box, border-box, etc.) that acts as the coordinate system for the clip-path.
User Space
The coordinate system established by the SVG if an SVG path is used as a reference.