Clipping Polygon
suggest changeCSS:
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.
Output:
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents