Desishub Lessons
Html and Css Tutorial
Css Clip-path

Css Clip-path

The clip-path property in CSS is a powerful tool that allows you to define a specific region of an element to display, effectively "clipping" the rest of the element. This can be used to create various shapes and mask effects, enhancing the visual appeal and creativity of your web design.

hello

ℹ️

Get started by visiting Css Clip-path Generator Clip-path Generator Page (opens in a new tab)

Basic Shapes

hello

Rectangle

Clips the element into a rectangle shape

Css
 
.rectangle {
     clip-path: inset(10% 20% 30% 40%)
}
 

This creates a diamond shape by specifying three points.

hello

Circle

Clips the element into a circular shape

Css
 
.circle {
    clip-path: circle(50%);
}
 

This creates a circular clip with a radius of 50% of the element's size.

trapezium

Clips the element into a trapezium shape

Css
 
.trapezium {
      clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
}
 

This creates a diamond shape by specifying four points.

trapezium

Triangle

Clips the element into a Triangle shape defined by a series of points.

Css
 
.triangle {
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}
 

This creates a diamond shape by specifying three points.

Triangle

Polygon

Clips the element into a polygonal shape defined by a series of points.

Css
 
.polygon {
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}
 

This creates a diamond shape by specifying four points.

ℹ️

Using the clip-path property with the inset() function allows you to create custom rectangular shapes by specifying insets from each side of the element. This can be useful for creating unique visual effects and layouts, enhancing the overall design and user experience of your web pages. By mastering the clip-path property, you can add dynamic and engaging elements to your designs