The clip-path property in CSS allows you to specify a specific region of an element to display, with the rest being hidden (or “clipped”) away.
.clip-me {
/* Example: clip away the element from the top, right, bottom, and left edges */
clip-path: inset(10px 20px 30px 40px); /* or "none" */
/* Example: clip element into a Heptagon */
clip-path: polygon(50% 0%, 90% 20%, 100% 60%, 75% 100%, 25% 100%, 0% 60%, 10% 20%);
/* Deprecated version */
position: absolute; /* absolute or fixed positioning required */
clip: rect(110px, 160px, 170px, 60px); /* or "auto" */
/* values descript a top/left point and bottom/right point */
}
There used to be a clip property, but note that is deprecated.
The most common use case would be an image, but it’s not limited to that. You could just as easily apply clip-path to a paragraph tag and only a portion of the text.
<img class="clip-me" src="/images/image-to-be-clipped.png" alt="Descriptioin of image">
<p class="clip-me">
I'll be clipped.
</p>
Those four values in inset() (in the CSS above) represent the top/left point and the bottom/right point, which forms the visible rectangle. Everything outside of that rectangle is hidden.

clip: rect() syntax very well.Other possible values:
.clip-me {
/* referencing path from an inline SVG */
clip-path: url(#c1);
/* referencing path from external SVG */
clip-path: url(path.svg#c1);
/* polygon */
clip-path: polygon(5% 5%, 100% 0%, 100% 75%, 75% 75%, 75% 100%, 50% 75%, 0% 75%);
/* circle */
clip-path: circle(30px at 35px 35px);
/* ellipse */
clip-path: ellipse(65px 30px at 125px 40px);
/* inset-rectangle() may replace inset() ? */
/* rectangle() coming in SVG 2 */
/* rounded corners... not sure if a thing anymore */
clip-path: inset(10% 10% 10% 10% round 20%, 20%);
}
Example SVG clip path:
<clipPath id="clipping">
<circle cx="150" cy="150" r="50" />
<rect x="150" y="150" width="100" height="100" />
</clipPath>
The clip-path property also supports the path() function, which makes clipping elements into shapes extremely easy. The CSS path() function enables us to create complex paths, polygons and other shapes using SVG path command syntax.
.hello {
width: 200px;
height: 200px;
background-color: aqua;
clip-path: path("M200 78c0 42-45 77-100 77-7 0-14 0-21-2l-44 47 12-57C18 129 0 104 0 78 0 35 45 0 100 0s100 35 100 78Z");
}
Make Your Own
Here’s a really neat editor for those from Mads Stoumann (which works for circles and ellipses as well):
Related Tricks!
Animating with Clip-Path
Angled Edges with CSS Masks and Transforms
Building A Circular Navigation with CSS Clip Paths
CSS Blob Recipes
CSS Grid and Custom Shapes, Part 1
Clipping and Masking in CSS
Clipping, Clipping, and More Clipping!
Cutting out the inner part of an element using clip-path
Hexagons and Beyond: Flexible, Responsive Grid Patterns, Sans Media Queries
Masking vs. Clipping: When to Use Each
Perfect Tooltips With CSS Clipping and Masking
Tricks to Cut Corners Using CSS Mask and Clip-Path Properties
Browser Support
Related
circle()
.shape { clip-path: circle(100px); }
ellipse()
.shape { clip-path: ellipse(60px 40px); }
inset()
.element { clip-path: inset(10px 2em 30% 3vw); }
path()
.element { clip-path: path("…"); }
polygon()
.element { clip-path: polygon(50% 0%, 75% 6.7%, 93.3% 25%, 100% 50%, 93.3% 75%, 75% 93.3%, 50% 100%, 25% 93.3%, 6.7% 75%, 0% 50%, 6.7% 25%, 25% 6.7%); }
shape()
.triangle { clip-path: shape(from 50% 0%, line by 50% 100%, hline to 0%, line to 50% 0%, close); }
Hey, glad you liked the image. :)
Just a quick correction. You said:
“The spec says to use commas to separate the values. IE 4-7 support this property, only without the spaces.”
I think you meant to say “…only without the commas” or “…only with spaces”.
“Those four values represent the “top/left” point and the “bottom/right” point, which forms the visible rectangle. Everything outside of that rectangle is hidden.”
I think that “top/left” should be “top/right” and “bottom/right” should be “bottom/left”.
Learn something new everyday :P
One note is that the commas should actually be avoided if you are supporting legacy versions of IE. Using a space to delineate the T R B L will work cross-browser.
BTW: We are huge fans of css-tricks here at Noble Desktop. Thanks for doing your thing!
Great article! Any idea about support on iOS. I’m using a 2nd Generation iPod Touch running iOS 4.2.3, but see no clip effect. Adding a
-webkit-prefix does nothing, it seems. Any ideas?Can I Use points to no IE support. What happened here?
The browser was shut down. So its effectively useless.
iOS 8 Safari doesn’t seem to support animated clip-paths, as I discovered while using velocity.js.
This is pretty cool, but it doesn’t seem to work on the video tag. How might I make this effect on the video tag? I’ve asked this question on StackOverflow.
Unfortunately they keep moving the goalposts and this article fails to indicate the before and after syntax which I think is very impotant if you want your clips to work in all browser versions.
I know that my v34 clips below work but I’m struggling to get the new v35s to work so any help would be appreciated:
I’m also interested in this article, I’ll be following but I don’t expect there to be many updates. As clip is now gone and clip-path only has partial support I’m curious as to any other ways to replicate this behavior or are we going to be stuck waiting for better browser support implementation (I really hope not).
it’s not validate for w3cvalidator, error like this Property clip-path doesn’t exist
.our-genius .style1 {
float:left;
position: relative;
/Chrome,Safari/
-webkit-clip-path: polygon(0px 424px,491px 500px,415px 0px,0px 0px);
-ms-clip-path: polygon(0px 424px,491px 500px,415px 0px,0px 0px);
/Firefox/
clip-path: url(“index.html#clipPolygon1”);
-moz-clip-path: url(“index.html#clipPolygon1”);
-moz-clip-path: polygon(0px 424px,491px 500px,415px 0px,0px 0px);
}
Hi. It’s work for swf content? It tried this for images but flash content is not clipped
Hi There,
clip-path ONLY works with a prefix in Webkit.. Perhaps such should be incorporated into this here article…
Also, the CSS implementation in most Browser is HIGHLY erratic and I suggest anyone that contemplates using Clipping in CSS – do it by simple wrapping the image or element in a surrounding DIV and setting THAT to overflow hidden and thus adjusting the DIV’s (which IS a rectangle) dimensions…
This works every time – in every browser….
Clip and clip-path IMPO should be avoided. At least until the people fumbling about with building web-browser, unite and agree…
Once again, a great proposition goes berserk !
I put together a little demo of three different clipping techniques. Have a look at mattias.pw/pens/2016/08/08/clipping-101/.
nice little demo there! Also thanks for reminding me about this article. Sadly clip-path hasn’t progressed anywhere near to where I’d wanted it to have by now. Coincidentally I’m working on a site currently where this would have been incredibly useful. Sadly I’ll have to result to SVG’s, maybe one day soon!
Hi there! Should I have to agree the -o- and -moz- prefix to make it work in non -webkit- browsers?
@keyframes rotacion-electrica {
-webkit-transition-timing-function: linear;
transition-timing-function: linear;
from {
-webkit-clip-path: circle(60% at 50% 50%);
clip-path: circle(60% at 50% 50%);
opacity: 0.9;
}
to {
-webkit-clip-path: circle(60% at 50% 50%);
-webkit-transform:rotate(0deg);
clip-path: circle(60% at 50% 50%);
transform: rotate(360deg);
opacity: 1;
}
}
Jean Phillip
http://www.iliiet.com/portal
If you want to, it doesn’t matter. You can use anyone depending on the browser of your choice.
How to use the clip-path property for MS Edge browser? There seems to be no support.
Also for Mozilla, we have to enable the layout.css.clip-path-shapes.enabled flag to true in order to support this rule, but my end customer might not know that, any workaround for that?
Any help would be appreciated! :)
What about clipping elements with background images?
Let’s imagine you have a div tag with simple (non repetitive) background image and want to cut the bottom of this tag. In addition a hover action is needed with 2px solid border. What would be a cross-browser and responsive solution?
Thanks for the great article!
Clip path = no IE / Edge support. http://caniuse.com/#feat=css-clip-path. Edge has marked it as a medium priority addition… since 2014.
the text gets disappeared from my polygon when I zoom-in I am new to styling would surely be glad to seek your inputs
-webkit-clip-path: polygon(0 51%, 100% 72%, 100% 100%, 0% 100%);
clip-path: polygon(0 51%, 100% 72%, 100% 100%, 0% 100%);
As of August 2019, MS Edge officially still does not yet support clip-path: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/18788318/
Their page (and their internally-linked documentation) is a joke. In some places support is “shipped” and “supported”, but then in others it’s stated as not supported at all.
I, like my many friends here, am loathed to continue hacking my pages using SVG for Microshaft compatibility. I’ve spent a career hacking up my clean HTML for the benefit of Microsoft browsers.
As we say in the UK, the left-hand doesn’t know what the right-hand is doing within their halls.
Shame on them. Why they haven’t just scrapped IE and Edge is beyond us all.
</rant>Is there a converter to translate absolute values to percents for responsive clipping paths for path?
If you need regular, equal-sided polygons – from a 3-sided triangle to a 100-sided hectogon – I’ve made a new tool just for this:
It also has an “inset”-option, which creates a mid-point on a polygon-side, which can be dragged inwards (for cool effects and animations!). There’s live-output of code, for both clip-path and SVG.
While clip image is the position of an image change from static to relative. If not then why it become visible.
So useful!
Thanks, that’s very useful!
Another property that exist but completely ignored until now
Your article and the wild methods you came up with were absolutely amazing! That said, in 2025 we get to use the
shapeCSS function, thank goodness. So, cutting out a shape (such as a fancy gradient glow around another object) is much easier, even if it still looks a bit intimidating at first.The shape I specified in the code below is actually two shapes: a rectangle 50px larger than its parent and a rectangle the same size as its parent with manually rounded corners using the
curvecommand, and the second shape is “cut out” while the first shape is what is allowed to show, thanks to theevenoddfill rule.As of February 2026, the shape function is now supported across all major browsers including Firefox both for PC and Mobile Devices. You can now use it for your projects in the near future as time flies by.