Properti clip-path memotong gambar menjadi poligon bintang, jajaran genjang, atau elips.
CSS Image Shapes
Contoh Kode CSS Image Shapes:
<!DOCTYPE html>
<html>
<head>
<style>
.bentuk-poligon {
width: 200px;
height: 200px;
object-fit: cover;
clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}
</style>
</head>
<body>
<img src="https://picsum.photos/300/300" class="bentuk-poligon" alt="Pentagon Image">
</body>
</html>
Uji dan amati bagaimana deklarasi CSS CSS Image Shapes mengubah tampilan elemen di atas.