clip-path with polygon() and circle()
Clip elements into custom polygon or circle shapes using the clip-path property.
clip-path with polygon() and circle() is a free CSS Academy lesson on CoddyKit. This is lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the CSS Academy learning path, and your progress syncs across the web and the CoddyKit app. The CSS Academy course includes 4 lessons in total.
What is clip-path?
clip-path clips the visible area of an element to a specified shape. Everything outside the shape is invisible (but still takes up space in the layout).
clip-path: circle()
Clip an element to a circular shape. The argument is the radius:
<div class="avatar"></div>
<div class="badge"></div>
clip-path: ellipse()
Clip to an ellipse by specifying x-radius, y-radius, and optional center position:
<div class="card-image"></div>
clip-path: polygon()
The most powerful clip-path. Define a polygon by listing x,y coordinate pairs:
<div class="hexagon"></div>
<div class="diagonal-cut"></div>
clip-path: inset()
Clip to a rectangle with optional rounded corners. Arguments are inset distances:
<div class="card"></div>
Clip-path for Section Shapes
Create angled section transitions between page sections:
<div class="section-diagonal">Diagonal Section</div>
Animating clip-path
clip-path with the same number of points can be transitioned for reveal and morph animations:
<div class="reveal visible"></div>
clip-path vs border-radius
For simple rounded shapes, border-radius is better — it works with background and border. Use clip-path when you need non-rectangular shapes that border-radius cannot achieve.
clip-path: path()
path() accepts an SVG path string for arbitrary shapes:
<div class="star"></div>
Performance Consideration
clip-path creates a new stacking context and may trigger paint on every frame when animated. Animating clip-path is more expensive than transform or opacity — combine carefully.
clip-path Reference Box
The coordinate system for clip-path is the element's border box (or margin box for SVG). Percentages are relative to the element's dimensions.
Quick Check
Which clip-path function creates an irregular non-rectangular shape defined by coordinate pairs?
Recap
clip-path clips elements to geometric shapes. circle() and ellipse() create rounded clips. polygon() defines any multi-vertex shape. inset() clips to a rectangle with optional rounding. Animate between polygon shapes with the same point count for dramatic reveals. Use path() for SVG-based arbitrary shapes.
Learn CSS with an AI tutor — free
Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.
- Courses
- 40
- Lessons
- 159
Frequently Asked Questions
Is the “clip-path with polygon() and circle()” lesson free?
Yes — the full text of “clip-path with polygon() and circle()” is free to read here on the web. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the CSS Academy course, upgrade to CoddyKit PRO. The CSS Academy course includes 4 lessons in total.
What will I learn in “clip-path with polygon() and circle()”?
Clip elements into custom polygon or circle shapes using the clip-path property. You practise CSS Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start CSS Academy?
No prior experience is required. CSS Academy on CoddyKit is structured for beginners through advanced learners, so you can start here or from the beginning and move at your own pace. This is lesson 1 of 4.
How long does the “clip-path with polygon() and circle()” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this CSS Academy lesson?
Yes. Every CSS Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- clip-path with polygon() and circle()
- shape-outside for Text Wrapping
- Animating clip-path Shapes
- CSS Masks vs Clip-path