Clip Path - Slanted Edges
UI & UX
</ head>
<!-- SNIPPET NAME HERE -->
<style>
/* clip elements to specific shapes */
/* provide 4 values for each side in the order: top, right, bottom, left to create the polygon */
/* the calc() property is used to make calculations based on viewport */
.cp-1{
clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10vw), 0 100%);
-webkit-clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10vw), 0 100%); /* webkit browsers */
}
.cp-2{
clip-path: polygon(0 calc(0% + 10vw), 100% 0, 100% 100%, 0 100%);
-webkit-clip-path: polygon(0 calc(0% + 10vw), 100% 0, 100% 100%, 0 100%); /* webkit browsers */
}
.cp-3{
clip-path: polygon(0 0, 100% 0, 100% 90%, 50% 100%,0 100%);
-webkit-clip-path: polygon(0 0, 100% 0, 100% 90%, 50% 100%,0 90%); /* webkit browsers */
}
.cp-4{
clip-path: polygon(0 0, 100% 0, 100% 90%, 25% 80%, 50% 100%, 5% 80%, 0 100%);
-webkit-clip-path: polygon(0 0, 100% 0, 100% 90%, 75% 80%, 50% 100%, 25% 80%, 0 90%); /* webkit browsers */
}
.cp-btn {
clip-path: polygon(0 10%, 100% 0, 100% 90%, 0 100%);
-webkit-clip-path: polygon(0 10%, 100% 0, 100% 90%, 0 100%); /* webkit browsers */
}
.cp-btn:hover {
clip-path: polygon(0 0, 100% 0, 100% 90%, 0 90%);
-webkit-clip-path: polygon(0 0, 100% 10%, 100% 100%, 0 90%); /* webkit browsers */
}
</style>
</ body>
HTML/Embed
<!-- SNIPPET NAME HERE -->
<style>
/* clip elements to specific shapes */
/* provide 4 values for each side in the order: top, right, bottom, left to create the polygon */
/* the calc() property is used to make calculations based on viewport */
.cp-1{
clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10vw), 0 100%);
-webkit-clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10vw), 0 100%); /* webkit browsers */
}
.cp-2{
clip-path: polygon(0 calc(0% + 10vw), 100% 0, 100% 100%, 0 100%);
-webkit-clip-path: polygon(0 calc(0% + 10vw), 100% 0, 100% 100%, 0 100%); /* webkit browsers */
}
.cp-3{
clip-path: polygon(0 0, 100% 0, 100% 90%, 50% 100%,0 100%);
-webkit-clip-path: polygon(0 0, 100% 0, 100% 90%, 50% 100%,0 90%); /* webkit browsers */
}
.cp-4{
clip-path: polygon(0 0, 100% 0, 100% 90%, 25% 80%, 50% 100%, 5% 80%, 0 100%);
-webkit-clip-path: polygon(0 0, 100% 0, 100% 90%, 75% 80%, 50% 100%, 25% 80%, 0 90%); /* webkit browsers */
}
.cp-btn {
clip-path: polygon(0 10%, 100% 0, 100% 90%, 0 100%);
-webkit-clip-path: polygon(0 10%, 100% 0, 100% 90%, 0 100%); /* webkit browsers */
}
.cp-btn:hover {
clip-path: polygon(0 0, 100% 0, 100% 90%, 0 90%);
-webkit-clip-path: polygon(0 0, 100% 10%, 100% 100%, 0 90%); /* webkit browsers */
}
</style>
Only tabs with a " " have code.
Only tabs with a " " have code.
Only tabs with a " " have code.
Only tabs with a " " have code.
If you have already pasted this code into your project then you can skip this. If you haven't, and it's your first time using CodeCrumbs, then copy this code and navigate to your sites global settings > Custom Code tab > paste it into the <head> (first custom code block). It just needs to exist once.
How to use:
Unlock more with PRO
Want to learn how to use this Crumb? Unlock detailed documentation, video tutorials, comments & support!
Upgrade to Pro
Unlock more with PRO
Want to learn how to use this Crumb? Unlock detailed documentation, video tutorials, comments & support!
Upgrade to Pro
Correction: I'm sorry I kept saying "web-clip" when I meant to say "clip-path." Carry on 😉
Tutorial Coming Soon!
Check Browser Support
Interactive Table
Contributor
CodeCrumbs Team
Short Description:
Shape the edge of your sections, buttons or other elements to give them more character with some CSS using the clip-path property.
Extra Info:
No extra info.
Clone Project
Documentation
Author:
N/A
Status:
Deprecated
New
Updated
This crumb is no longer being supported.
Latest Version:
More related crumbs..
Want to contribute to the community?
Tell us what code you're working with. We would love to see it and possibly add it to the library.