Clipping Polygon

suggest change

CSS:

div{
  width:200px;
  height:200px;
  background:teal;
  clip-path: polygon(0 0, 0 100%, 100% 50%);
}

HTML:

<div></div>

In the above example, a polygonal clipping path clips the 200×200 square into a triangle. The path starts at 0 0 (the top-left corner), goes to 0 100% (the bottom-left corner), and then to 100% 50% (the midpoint of the right edge). The path is closed automatically, so the final shape is a triangle.

This can also be used on an element with an image or a gradient as background.

View Example

Output:

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents