clip-path: <clip-source> | [ <basic-shape> || <geometry-box> || none
clip-source
basic-shape
geometry-box
none
<!DOCTYPE html>
<html>
<head>
</head>
<style>
.example {
clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}
.example1 {
clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
</style>
<body>
<center>
<h3> Clip-path property example </h3>
<img src="../images/logo.png" class="example">
<h4>Diamond shape polygon</h4>
<p>clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);</p>
<img src="../images/logo.png" class="example1">
<h4>Star shape polygon</h4>
<p>clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);</p>
</center>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
</head>
<style>
.example {
clip-path: circle(50%);
}
.example1 {
clip-path: circle(60% at 70% 20%);
}
</style>
<body>
<center>
<h2> Clip-path property example </h2>
<img src="../images/logo.png" class="example">
<h3>clip-path: circle(50%);</h3>
<img src="../images/logo.png" class="example1">
<h3>clip-path: circle(60% at 70% 20%);</h3>
</center>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
</head>
<style>
.example {
clip-path: ellipse(50% 35%);
}
.example1 {
clip-path: ellipse(50% 65% at 70% 50%);
}
</style>
<body>
<center>
<h2> Clip-path property example </h2>
<img src="../images/logo.png" class="example">
<h3> clip-path: ellipse(50% 35%);</h3>
<img src="../images/logo.png" class="example1">
<h3> clip-path: ellipse(50% 65% at 70% 50%);</h3>
</center>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
</head>
<style>
.example {
clip-path: inset(20% 25% 20% 10%);
}
.example1 {
clip-path: inset(45% 0% 33% 10% round 10px);
}
</style>
<body>
<center>
<h2> Clip-path property example </h2>
<img src="../images/logo.png" class="example">
<h3>clip-path: inset(20% 25% 20% 10%);</h3>
<img src="../images/logo.png" class="example1">
<h3>clip-path: inset(45% 0% 33% 10% round 10px);</h3>
</center>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
</head>
<style>
img.example {
animation: anime 4s infinite;
border: 5px dashed red;
}
@keyframes anime {
0% {
clip-path: polygon(0 0, 100% 0, 100% 80%, 0% 70%);
}
20% {
clip-path: polygon(40% 0, 50% 0, 100% 100%, 0% 80%);
}
40% {
clip-path: polygon(0 0, 60% 72%, 100% 100%, 0 35%);
}
60% {
clip-path: polygon(70% 0, 20% 0, 100% 100%, 0% 80%);
}
80% {
clip-path: polygon(0 70%, 60% 0, 100% 32%, 0 40%);
}
100% {
clip-path: polygon(0 0, 60% 0, 100% 100%, 0% 30%);
}
}
</style>
<body>
<center>
<h2> Animation in Clip-path property </h2>
<img src="../images/logo.png" class="example">
</center>
</body>
</html>