The clip-path property clips elements to custom shapes — circles, polygons, inset boxes, and SVG paths — for creative layouts and visual effects.
01
Custom Shapes
Clip to any region.
02
circle()
Round avatars.
03
polygon()
Triangles, stars.
04
inset()
Rounded crops.
05
none Default
No clipping.
06
SVG url()
Complex paths.
Fundamentals
Definition and Usage
The clip-path CSS property is a powerful tool that lets you create complex shapes and clip an element to a specific region. You can hide parts of an element or create interesting visual effects by defining its visible area.
You can use basic shapes like circle(), ellipse(), polygon(), and inset(), or reference custom SVG paths. Unlike the legacy clip property, clip-path works on most elements without requiring absolute positioning.
💡
Beginner Tip
Start with clip-path: circle(50%) for profile photos, then try polygon() for triangles and diagonal sections.
Foundation
📝 Syntax
The syntax for clip-path varies depending on the shape or path you want to use:
ellipse(45% 50% at 50% 50%) sets horizontal radius, vertical radius, and center position for an oval clip.
Compare
clip-path vs clip
Feature
clip-path
clip (legacy)
Shapes
Circle, ellipse, polygon, inset, path, SVG
Rectangle only (rect())
Positioning
Works on most elements
Requires absolute/fixed positioning
Status
Modern, recommended
Deprecated
Animation
Supported between compatible shapes
Not practical
🧠 How clip-path Works
1
You choose a clipping shape
Pick a function like circle(), polygon(), or an SVG url() reference.
Shape definition
2
Browser builds a clip region
The shape becomes a clipping path relative to the element’s bounding box.
Rendering
3
Content outside is hidden
Only pixels inside the clip region are painted. The rest of the element is invisible.
Masking
=
⬡
Custom-shaped visible element
Your box, image, or card appears in the exact shape you defined — circle, triangle, oval, or more.
Compatibility
Modern Browser Support
The clip-path property is supported in most modern browsers, including Chrome, Firefox, Safari, Edge, and Opera. Test across browsers when using complex shapes or animations.
✓ Baseline · Modern browsers
Shape clipping in today’s browsers
All major browsers support basic shape functions. SVG url() references and animations may vary slightly.
97%Modern browser support
Google Chrome55+ · Desktop & Mobile
Full support
Mozilla Firefox54+ · Desktop & Mobile
Full support
Apple Safari9.1+ · macOS & iOS
Full support
Microsoft Edge79+ · Chromium
Full support
Opera42+ · Modern versions
Full support
clip-path property97% supported
Bottom line: Use clip-path freely for circles, polygons, and inset shapes. Test SVG url() clips and animations in your target browsers.
Wrap Up
Conclusion
The clip-path property is a versatile tool for creating unique and visually appealing designs. By clipping elements to various shapes and paths, you can achieve creative layouts and effects that enhance the user experience.
Experiment with different shapes and clipping paths — from simple circles to complex polygons — to see how this property can transform your web projects.
Use clip-path: circle(50%) for round avatars and thumbnails
Try polygon() for diagonal hero sections and creative cards
Prefer clip-path over legacy clip for new projects
Test clipped interactive elements — clicks may still hit hidden areas
Use inset() with round for soft rectangular crops
❌ Don’t
Hide essential text or controls with clipping — users cannot see clipped content
Assume clipped-away areas block pointer events by default
Overuse complex polygons without testing on mobile performance
Forget accessibility — provide alt text for clipped images
Rely on clipping alone when border-radius or SVG masks are simpler
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about clip-path
Use these points when shaping elements with CSS.
5
Core concepts
⬡01
Custom shapes
Clip any visible region.
Purpose
⚙02
none Default
No clipping applied.
Default
○03
Shape functions
circle, polygon, inset.
Values
🖼04
SVG url()
Complex path clips.
Advanced
🛸05
Modern choice
Replaces legacy clip.
Compare
❓ Frequently Asked Questions
clip-path clips an element to a custom visible region. You can use basic shapes like circles and polygons or SVG paths to hide parts of an element and create creative visual effects.
The initial value is none, which means no clipping is applied and the entire element remains visible.
clip only supports rectangular regions with rect() on positioned elements. clip-path supports circles, ellipses, polygons, inset(), and SVG paths on most elements — it is the modern choice.
Common functions include circle(), ellipse(), polygon(), inset(), and path(). You can also reference an SVG clipPath element with url().
Yes. clip-path can transition between compatible shapes in supporting browsers, which enables smooth morphing effects for hover states and animations.